manager() public static method

Get the JWTManager instance.
public static manager ( ) : Tymon\JWTAuth\JWTManager
return Tymon\JWTAuth\JWTManager
Ejemplo n.º 1
0
 /**
  * @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.
     }
 }