summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2013-08-29 08:54:01 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2013-08-29 08:54:01 +0200
commit3e3f563e288cc4513a5896bb807d44583daa963c (patch)
tree8488f251a679a27499c7f9b688af4fe18cf0768e
parent0c7673d6453637200bc06ff4a478ac60df6eb9de (diff)
parent5d2b42d10d4b6d92684edd9db0ef89dabe14dae6 (diff)
downloadsymfony-security-3e3f563e288cc4513a5896bb807d44583daa963c.zip
symfony-security-3e3f563e288cc4513a5896bb807d44583daa963c.tar.gz
symfony-security-3e3f563e288cc4513a5896bb807d44583daa963c.tar.bz2
Merge branch '2.3'
* 2.3: Clear lazy loading initializer after the service is successfully initialized [FrameworkBundle] added support for double-quoted strings in the extractor (closes #8797) [SecurityBundle] Move format-dependent tests from SecurityExtensionTest bumped Symfony version to 2.3.5-DEV updated VERSION for 2.3.4 updated CHANGELOG for 2.3.4 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. fix typo in test skipped message [Form] Fixed Form::all() signature for PHP 5.3.3 [Form] Fixed Form::all() signature for PHP 5.3.3 [Locale] Fixed: Locale::setDefault() throws no exception when "en" is passed [Locale] Fixed: StubLocale::setDefault() throws no exception when "en" is passed [Translation] Grammar fix [Yaml] fixed embedded folded string parsing [Validator] fixed Boolean handling in XML constraint mappings (closes #5603) [Translation] Fixed regression: When only one rule is passed to transChoice(), this rule should be used Conflicts: src/Symfony/Component/HttpKernel/Kernel.php
-rw-r--r--Http/Firewall/AbstractPreAuthenticatedListener.php10
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()));
}
}
}