summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
authorJohannes Schmitt <schmittjoh@gmail.com>2011-07-13 18:36:17 +0200
committerJohannes Schmitt <schmittjoh@gmail.com>2011-07-13 18:49:52 +0200
commit30a106b213e1573f899983fe3f1138476a4e06c3 (patch)
treef9fec0fb80bfa09c6b790f485990cc1b33869af5 /Http
parentb79f41de462fd3aab9761fc46a29954a12e93a95 (diff)
downloadsymfony-security-30a106b213e1573f899983fe3f1138476a4e06c3.zip
symfony-security-30a106b213e1573f899983fe3f1138476a4e06c3.tar.gz
symfony-security-30a106b213e1573f899983fe3f1138476a4e06c3.tar.bz2
[Security] changed order of checks to check for more specific things first
Diffstat (limited to 'Http')
-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);