public static manager ( ) : Tymon\JWTAuth\JWTManager | ||
return | Tymon\JWTAuth\JWTManager |
public static function manager()
{
return \Tymon\JWTAuth\JWTAuth::manager();
}
/** * @param $token */ public static function invalidate($token) { \JWTAuth::setToken($token); $payload = \JWTAuth::manager()->getJWTProvider()->decode($token); $userId = ArrayUtils::get($payload, 'user_id'); $exp = ArrayUtils::get($payload, 'exp'); static::removeTokenMap($userId, $exp); try { \JWTAuth::invalidate(); } catch (TokenExpiredException $e) { //If the token is expired already then do nothing here. The token map is already removed above. } }