diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2013-08-27 10:54:20 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2013-08-27 10:54:20 +0200 |
commit | 5d2b42d10d4b6d92684edd9db0ef89dabe14dae6 (patch) | |
tree | 1acae90e7655757af5de41d69df5e4b50288c4cf | |
parent | eb3213ef7a4d51816c1aaf7375897e0c040acb8b (diff) | |
parent | 1470a1a7f44c24eaa288a6dd7d43f4a51d8045dd (diff) | |
download | symfony-security-5d2b42d10d4b6d92684edd9db0ef89dabe14dae6.zip symfony-security-5d2b42d10d4b6d92684edd9db0ef89dabe14dae6.tar.gz symfony-security-5d2b42d10d4b6d92684edd9db0ef89dabe14dae6.tar.bz2 |
Merge branch '2.2' into 2.3v2.3.4
* 2.2:
bumped Symfony version to 2.2.7
updated VERSION for 2.2.6
update CONTRIBUTORS for 2.2.6
updated CHANGELOG for 2.2.6
clearToken exception is thrown at wrong place.
Conflicts:
src/Symfony/Component/HttpKernel/Kernel.php
-rw-r--r-- | Http/Firewall/AbstractPreAuthenticatedListener.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Http/Firewall/AbstractPreAuthenticatedListener.php b/Http/Firewall/AbstractPreAuthenticatedListener.php index e248c6d..fdc2e8c 100644 --- a/Http/Firewall/AbstractPreAuthenticatedListener.php +++ b/Http/Firewall/AbstractPreAuthenticatedListener.php @@ -63,7 +63,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface try { list($user, $credentials) = $this->getPreAuthenticatedData($request); } catch (BadCredentialsException $exception) { - $this->clearToken(); + $this->clearToken($exception); return; } @@ -91,21 +91,23 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent); } } catch (AuthenticationException $failed) { - $this->clearToken(); + $this->clearToken($failed); } } /** * Clears a PreAuthenticatedToken for this provider (if present) + * + * @param AuthenticationException $exception */ - protected function clearToken() + private function clearToken(AuthenticationException $exception) { $token = $this->securityContext->getToken(); if ($token instanceof PreAuthenticatedToken && $this->providerKey === $token->getProviderKey()) { $this->securityContext->setToken(null); if (null !== $this->logger) { - $this->logger->info(sprintf("Cleared security context due to exception: %s", $failed->getMessage())); + $this->logger->info(sprintf("Cleared security context due to exception: %s", $exception->getMessage())); } } } |