Created
October 25, 2013 08:51
-
-
Save Tobur/7151622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function onFailure(GetResponseEvent $event, Request $request, AuthenticationException $failed) | |
{ | |
if (null !== $this->logger) { | |
$this->logger->info(sprintf('Authentication request failed: %s', $failed->getMessage())); | |
} | |
$token = $this->securityContext->getToken(); | |
if ($token instanceof UsernamePasswordToken && $this->providerKey === $token->getProviderKey()) { | |
$this->securityContext->setToken(null); | |
} | |
$response = $this->failureHandler->onAuthenticationFailure($request, $failed); | |
if (!$response instanceof Response) { | |
throw new \RuntimeException('Authentication Failure Handler did not return a Response.'); | |
} | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment