JWTAuth::invalidate PHP Method

invalidate() public static method

Invalidate a token (add it to the blacklist).
public static invalidate ( mixed $token = false ) : boolean
$token mixed
return boolean
        public static function invalidate($token = false)
        {
            return \Tymon\JWTAuth\JWTAuth::invalidate($token);
        }

Usage Example

コード例 #1
1
ファイル: AuthController.php プロジェクト: abcn/hhgapi
 public function logout()
 {
     //获取当前用户token
     $token = \JWTAuth::getToken();
     //让token失效
     try {
         \JWTAuth::invalidate($token);
         return return_rest('1', '', '已退出登录');
     } catch (\Exception $e) {
         return return_rest('0', '', $e->getMessage());
     }
 }
All Usage Examples Of JWTAuth::invalidate