Exemple #1
0
 /**
  * @return bool
  */
 public static function logout()
 {
     $token = static::getSessionToken();
     if (empty($token)) {
         return false;
     }
     JWTUtilities::invalidate($token);
     return true;
 }
Exemple #2
0
 /**
  * @return bool
  * @throws \Exception
  */
 public static function logout()
 {
     $token = static::getSessionToken();
     if (empty($token)) {
         return false;
     }
     try {
         JWTUtilities::invalidate($token);
     } catch (\Exception $e) {
         if (!$e instanceof TokenBlacklistedException) {
             throw $e;
         }
     }
     return true;
 }