Skip to content

Commit

Permalink
[Security] changed order of checks to check for more specific things …
Browse files Browse the repository at this point in the history
…first
  • Loading branch information
schmittjoh committed Jul 13, 2011
1 parent 4259530 commit 29e4063
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,19 @@ public final function handle(GetResponseEvent $event)
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);

Expand Down

0 comments on commit 29e4063

Please sign in to comment.