Exemple #1
0
 /**
  * Refresh a Token and return a new Token
  *
  * @param  \Tymon\JWTAuth\Token  $token
  * @return \Tymon\JWTAuth\Token
  */
 public function refresh(Token $token)
 {
     $payload = $this->setRefreshFlow()->decode($token);
     if ($this->blacklistEnabled) {
         // invalidate old token
         $this->blacklist->add($payload);
     }
     // return the new token
     return $this->encode($this->payloadFactory->make(['sub' => $payload['sub'], 'iat' => $payload['iat']]));
 }
 /**
  * Create the Payload instance.
  *
  * @param array $customClaims
  * @return \Tymon\JWTAuth\Payload 
  * @static 
  */
 public static function make($customClaims = array())
 {
     return \Tymon\JWTAuth\PayloadFactory::make($customClaims);
 }