Q:

logout lumen passport

public function logout(Request $request) {
    $token = $request->bearerToken();
    if ($token) {
        $id = (new Parser())->parse($token)->getHeader('jti');
        DB::table('oauth_access_tokens')->where('id', '=', $id)->update(['revoked' => 1]);
    }
 
    return [
        'status' => 'success',
        'message' => 'Logout successfully.'
    ];
}
0
public function logoutApi()
{ 
    if (Auth::check()) {
       Auth::user()->AauthAcessToken()->delete();
    }
}
0

New to Communities?

Join the community