/**
  * @param $token
  * @throws \Tymon\JWTAuth\Exceptions\TokenBlacklistedException
  * @return mixed
  */
 public function getUserIdFromToken($token)
 {
     $payload = $this->jwtManager->decode($token);
     $userId = $payload->get('sub');
     return $userId;
 }
Exemple #2
0
 /**
  * Get the raw Payload instance.
  *
  * @param mixed $token
  *
  * @return \Tymon\JWTAuth\Payload
  */
 public function getPayload($token = false)
 {
     $this->requireToken($token);
     return $this->manager->decode($this->token);
 }