/** * Decode a Token and return the Payload * * @param \Tymon\JWTAuth\Token $token * @return Payload * @throws TokenBlacklistedException */ public function decode(Token $token) { $payloadArray = $this->jwt->decode($token->get()); $payload = $this->payloadFactory->setRefreshFlow($this->refreshFlow)->make($payloadArray); if ($this->blacklistEnabled && $this->blacklist->has($payload)) { throw new TokenBlacklistedException('The token has been blacklisted'); } return $payload; }
/** * Set the refresh flow. * * @param bool $refreshFlow * @return $this * @static */ public static function setRefreshFlow($refreshFlow = true) { return \Tymon\JWTAuth\PayloadFactory::setRefreshFlow($refreshFlow); }