/**
  * Returns serialized token.
  *
  * @param Token $token
  * @return string
  */
 public function serializeToken(Token $token)
 {
     $payload = array('id' => $token->getAuthIdentifier(), 'key' => $token->getPublicKey());
     return $this->encrypter->encrypt($payload);
 }
Esempio n. 2
0
 /**
  * Retrive user from auth token.
  *
  * @param Token $token
  * @return UserInterface|null
  */
 public function user(Token $token)
 {
     return $this->users->retrieveByID($token->getAuthIdentifier());
 }