Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function mountToken(Request $request, Response $response, TokenInterface $token)
 {
     if (!$token instanceof SessionToken) {
         throw new InvalidTokenException("Only session tokens are allowed");
     }
     $this->session->set($this->key, $token->getUserPK());
     return $response;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function mountToken(Request $request, Response $response, TokenInterface $token)
 {
     return $response->withAddedHeader($this->header, $token->getHash());
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function mountToken(Request $request, Response $response, TokenInterface $token)
 {
     return $response->withAddedHeader('Set-Cookie', $this->cookieHeader($request, $token->getHash()));
 }
Exemplo n.º 4
0
 /**
  * @param TokenInterface $token
  * @return UserInterface
  */
 public function getUser(TokenInterface $token)
 {
     return $this->userSource()->findByPK($token->getUserPK());
 }