/** * @return bool */ public static function logout() { $token = static::getSessionToken(); if (empty($token)) { return false; } JWTUtilities::invalidate($token); return true; }
/** * @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; }