diff options
author | Ryan Weaver <ryan@thatsquality.com> | 2016-02-06 17:29:58 -0500 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2016-03-02 13:34:27 +0100 |
commit | 0d6c99afcc9f9392a4eea87caa9b197f176d54b7 (patch) | |
tree | 3a1cb28f5513b7e3b19394aabf624fe138915824 /Http/Firewall | |
parent | a07df7b1ba2f304191e4b2232072f34475bd5bcc (diff) | |
download | symfony-security-0d6c99afcc9f9392a4eea87caa9b197f176d54b7.zip symfony-security-0d6c99afcc9f9392a4eea87caa9b197f176d54b7.tar.gz symfony-security-0d6c99afcc9f9392a4eea87caa9b197f176d54b7.tar.bz2 |
Adding new TargetPathTrait to get/set the authentication "target_path"
Diffstat (limited to 'Http/Firewall')
-rw-r--r-- | Http/Firewall/ExceptionListener.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php index a1cae2a..2804d0e 100644 --- a/Http/Firewall/ExceptionListener.php +++ b/Http/Firewall/ExceptionListener.php @@ -22,6 +22,7 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException; use Symfony\Component\Security\Core\Exception\LogoutException; +use Symfony\Component\Security\Http\Util\TargetPathTrait; use Symfony\Component\Security\Http\HttpUtils; use Symfony\Component\HttpFoundation\Request; use Psr\Log\LoggerInterface; @@ -39,6 +40,8 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; */ class ExceptionListener { + use TargetPathTrait; + private $tokenStorage; private $providerKey; private $accessDeniedHandler; @@ -210,7 +213,7 @@ class ExceptionListener { // session isn't required when using HTTP basic authentication mechanism for example if ($request->hasSession() && $request->isMethodSafe() && !$request->isXmlHttpRequest()) { - $request->getSession()->set('_security.'.$this->providerKey.'.target_path', $request->getUri()); + $this->saveTargetPath($request->getSession(), $this->providerKey, $request->getUri()); } } } |