Skip to content

Commit

Permalink
Remove security token if user was deleted, is disabled or locked to p…
Browse files Browse the repository at this point in the history
…revent infinite redirect loops to the login path (fixes #1798).
  • Loading branch information
snc committed Nov 10, 2011
1 parent 5882a98 commit 4d80ebd
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\AccountStatusException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException;
use Symfony\Component\Security\Http\HttpUtils;
Expand Down Expand Up @@ -158,6 +159,11 @@ private function startAuthentication(Request $request, AuthenticationException $

$this->setTargetPath($request);

if ($authException instanceof AccountStatusException) {
// remove the security token to prevent infinite redirect loops
$this->context->setToken(null);
}

return $this->authenticationEntryPoint->start($request, $authException);
}

Expand Down

0 comments on commit 4d80ebd

Please sign in to comment.