Пример #1
0
 public function setUp()
 {
     parent::setUp();
     $this->user = UserStub::create();
     $this->jwtService = new JWTService();
     $this->token = Token::fromUser($this->user);
 }
Пример #2
0
 /**
  * requestAccessToken
  * @param User $user
  * @return EncodedToken
  */
 public function requestAccessToken(User $user)
 {
     $token = Token::fromUser($user);
     return $this->jsonTokenService->encode($token);
 }
Пример #3
0
 /**
  * Create a new EncodedToken
  *
  * @param $token
  * @return EncodedToken
  */
 public function encode(Token $token)
 {
     return EncodedToken::fromNative(JWT::encode($token->toArray(), $this->key));
 }