public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { return; } if ($this->key !== $token->getKey()) { throw new BadCredentialsException('The presented key does not match.'); } $user = $token->getUser(); $this->userChecker->checkPostAuth($user); $authenticatedToken = new RememberMeToken($user, $this->providerKey, $this->key); $authenticatedToken->setAttributes($token->getAttributes()); return $authenticatedToken; }