diff options
author | Grégoire Pineau <lyrixx@lyrixx.info> | 2015-07-24 17:06:07 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-07-26 20:14:09 +0200 |
commit | 6c3c1e2f6886107956e165ab236f34c159187e16 (patch) | |
tree | 0b0e3dbfb74a45c50d33d6dda82b81e71ed28151 | |
parent | 39fae4de46ca087fbead4f2ee75c1647cad277ad (diff) | |
download | symfony-security-6c3c1e2f6886107956e165ab236f34c159187e16.zip symfony-security-6c3c1e2f6886107956e165ab236f34c159187e16.tar.gz symfony-security-6c3c1e2f6886107956e165ab236f34c159187e16.tar.bz2 |
[Security] Do not save the target path in the session for a stateless firewall
-rw-r--r-- | Http/Firewall/ExceptionListener.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php index 57321fb..8553c75 100644 --- a/Http/Firewall/ExceptionListener.php +++ b/Http/Firewall/ExceptionListener.php @@ -46,8 +46,9 @@ class ExceptionListener private $errorPage; private $logger; private $httpUtils; + private $stateless; - public function __construct(SecurityContextInterface $context, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null) + public function __construct(SecurityContextInterface $context, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null, $stateless = false) { $this->context = $context; $this->accessDeniedHandler = $accessDeniedHandler; @@ -57,6 +58,7 @@ class ExceptionListener $this->authenticationTrustResolver = $trustResolver; $this->errorPage = $errorPage; $this->logger = $logger; + $this->stateless = $stateless; } /** @@ -178,7 +180,9 @@ class ExceptionListener $this->logger->debug('Calling Authentication entry point'); } - $this->setTargetPath($request); + if (!$this->stateless) { + $this->setTargetPath($request); + } if ($authException instanceof AccountStatusException) { // remove the security token to prevent infinite redirect loops |