summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2011-07-13 19:12:19 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2011-07-13 19:12:19 +0200
commitb1b06408ebac0bb6eaad3d9e729020727b7f65d6 (patch)
treeaeacb62e320017d2a1a75cb198d7add06edee431
parentd6afd064ae4489896f079c2e303e436f517542a8 (diff)
parent30a106b213e1573f899983fe3f1138476a4e06c3 (diff)
downloadsymfony-security-b1b06408ebac0bb6eaad3d9e729020727b7f65d6.zip
symfony-security-b1b06408ebac0bb6eaad3d9e729020727b7f65d6.tar.gz
symfony-security-b1b06408ebac0bb6eaad3d9e729020727b7f65d6.tar.bz2
merged branch schmittjoh/abstractAuthenticationListener (PR #1683)
Commits ------- 29e4063 [Security] changed order of checks to check for more specific things first Discussion ---------- [Security] changed order of checks
-rw-r--r--Http/Firewall/AbstractAuthenticationListener.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/Http/Firewall/AbstractAuthenticationListener.php b/Http/Firewall/AbstractAuthenticationListener.php
index 52aff57..f5969d8 100644
--- a/Http/Firewall/AbstractAuthenticationListener.php
+++ b/Http/Firewall/AbstractAuthenticationListener.php
@@ -126,19 +126,19 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
return;
}
- try {
- if (null === $returnValue = $this->attemptAuthentication($request)) {
- return;
- }
-
- if (!$request->hasSession()) {
- throw new \RuntimeException('This authentication method requires a session.');
- }
+ if (!$request->hasSession()) {
+ throw new \RuntimeException('This authentication method requires a session.');
+ }
+ try {
if (!$request->hasPreviousSession()) {
throw new SessionUnavailableException('Your session has timed-out, or you have disabled cookies.');
}
+ if (null === $returnValue = $this->attemptAuthentication($request)) {
+ return;
+ }
+
if ($returnValue instanceof TokenInterface) {
$this->sessionStrategy->onAuthentication($request, $returnValue);