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/Authentication | |
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/Authentication')
-rw-r--r-- | Http/Authentication/DefaultAuthenticationSuccessHandler.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Http/Authentication/DefaultAuthenticationSuccessHandler.php b/Http/Authentication/DefaultAuthenticationSuccessHandler.php index 078a366..38690c7 100644 --- a/Http/Authentication/DefaultAuthenticationSuccessHandler.php +++ b/Http/Authentication/DefaultAuthenticationSuccessHandler.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Http\Authentication; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Http\Util\TargetPathTrait; use Symfony\Component\Security\Http\HttpUtils; use Symfony\Component\Security\Http\ParameterBagUtils; @@ -25,6 +26,8 @@ use Symfony\Component\Security\Http\ParameterBagUtils; */ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface { + use TargetPathTrait; + protected $httpUtils; protected $options; protected $providerKey; @@ -113,8 +116,8 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle return $targetUrl; } - if (null !== $this->providerKey && $targetUrl = $request->getSession()->get('_security.'.$this->providerKey.'.target_path')) { - $request->getSession()->remove('_security.'.$this->providerKey.'.target_path'); + if (null !== $this->providerKey && $targetUrl = $this->getTargetPath($request->getSession(), $this->providerKey)) { + $this->removeTargetPath($request->getSession(), $this->providerKey); return $targetUrl; } |