There was an error while loading. Please reload this page.
Note: Revoke & flush data inside the service
POST /logout
204
curl -X 'POST' \ 'http://localhost/api/logout' \ -H 'accept: application/json' \ -H 'Authorization: Bearer eyJ0eXAiOiJKV1...' \ -d ''
{}
Make route function the following:
# routes/api.php Route::group([ 'middleware' => 'auth:api', ], function ($router) { Route::post('logout', 'AuthController@logout'); });
Make Refresh function the following:
# App\Http\Controllers\AuthController; public function logout(Request $request) { auth('api')->logout(); return response()->noContent(); }
sequenceDiagram Controller->>SunGuard: Logout SunGuard->>SunJWT: Revoke token & access token! SunJWT-->>SunGuard: Throw JWT Exception SunGuard-->>Controller: Successful!