Search
Search
Search
Search
Information
Information
Light
Dark
Open actions menu
Basic upload method
Bypass upload method
Tips!
If you encounter an error (by firewall) while uploading using both methods,
try changing extension of the file before uploading it and rename it right after.
This uploader supports multiple file upload.
Submit
~
var
www
downloadpodiofiles.bitkit.dk
httpdocs
app
Http
Controllers
File Content:
AuthController.php
<?php namespace App\Http\Controllers; use App\Http\Services\PodioBrowserSession; use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class AuthController extends Controller { public function Authentication(Request $request) { try { $code = $request->code; if ($code) { \Podio::setup( config('podio.client_id'), config('podio.client_secret'), [ 'session_manager' => new PodioBrowserSession(), ] ); \Podio::authenticate('authorization_code', [ 'code' => $code, 'redirect_uri' => 'http://localhost:8000/getAuthToken', ]); } $token = \Podio::$oauth; if (\Podio::is_authenticated()) { $profile = \Podio::get('/user/profile')->json_body(); $user = User::updateOrCreate(['user_id' => $profile['user_id']]); $userData = [ 'name' => $profile['name'] ?? null, 'email' => $profile['mail'][0] ?? null, 'password' => password_hash(microtime(), PASSWORD_DEFAULT), 'access_token' => $token->access_token, 'refresh_token' => $token->refresh_token, 'expires_in' => time() + $token->expires_in, ]; $user->update($userData); $user->save(); Auth::login($user, true); $encryptToken = encrypt($token->refresh_token); return response()->json([ 'status' => true, 'message' => 'authentication success', 'code' => $encryptToken ]); } } catch (\Exception $e) { return response()->json(["status" => 400, "message" => $e->getMessage(), "error" => $e]); } } public function checkTokenExpired() { try { $authUser = auth()->user(); $authDetails = User::where('user_id', $authUser->user_id)->first(); if ($authDetails->expires_in <= time()) { \Podio::setup( config('podio.client_id'), config('podio.client_secret'), [ 'session_manager' => new PodioBrowserSession(), ] ); \Podio::authenticate('refresh_token', array('refresh_token' => $authDetails->refresh_token)); $token = \Podio::$oauth; $userData = [ 'access_token' => $token->access_token, 'refresh_token' => $token->refresh_token, 'expires_in' => time() + $token->expires_in, ]; $authDetails->update($userData); $authDetails->save(); return true; } else { return true; } } catch (\Exception $e) { return response()->json(["status" => 400, "message" => $e->getMessage(), "error" => $e]); } } }
Edit
Download
Unzip
Chmod
Delete