Beispiel #1
0
 /**
  * @param JWTAuth $jwt
  * @return JsonResponse
  */
 public function getIndex(JWTAuth $jwt)
 {
     if ($jwt->getToken() !== false) {
         $jwt->invalidate();
     }
     return new JsonResponse();
 }
Beispiel #2
0
 public function getIndex(JWTAuth $jwt)
 {
     if ($token = $jwt->getToken()) {
         event(new UserLoggedOut($jwt->toUser($token)));
         $jwt->invalidate($token);
     }
     return $this->jsonResponse(null);
 }
 /**
  * Invalidate a token (add it to the blacklist).
  *
  * @param mixed $token
  * @return bool 
  * @static 
  */
 public static function invalidate($token = false)
 {
     return \Tymon\JWTAuth\JWTAuth::invalidate($token);
 }
Beispiel #4
0
 private function abort()
 {
     $this->auth->invalidate();
     abort(401);
 }