diff options
Diffstat (limited to 'Http')
-rw-r--r-- | Http/Authentication/DefaultAuthenticationSuccessHandler.php | 11 | ||||
-rw-r--r-- | Http/Firewall/UsernamePasswordFormAuthenticationListener.php | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/Http/Authentication/DefaultAuthenticationSuccessHandler.php b/Http/Authentication/DefaultAuthenticationSuccessHandler.php index 88dcf68..deb7d45 100644 --- a/Http/Authentication/DefaultAuthenticationSuccessHandler.php +++ b/Http/Authentication/DefaultAuthenticationSuccessHandler.php @@ -29,16 +29,19 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle { protected $httpUtils; protected $options; + protected $providerKey; /** * Constructor. * * @param HttpUtils $httpUtils + * @param string $providerKey * @param array $options Options for processing a successful authentication attempt. */ - public function __construct(HttpUtils $httpUtils, array $options) + public function __construct(HttpUtils $httpUtils, $providerKey, array $options) { - $this->httpUtils = $httpUtils; + $this->httpUtils = $httpUtils; + $this->providerKey = $providerKey; $this->options = array_merge(array( 'always_use_default_target_path' => false, @@ -75,8 +78,8 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle } $session = $request->getSession(); - if ($targetUrl = $session->get('_security.target_path')) { - $session->remove('_security.target_path'); + if ($targetUrl = $session->get('_security.'.$this->providerKey.'.target_path')) { + $session->remove('_security.'.$this->providerKey.'.target_path'); return $targetUrl; } diff --git a/Http/Firewall/UsernamePasswordFormAuthenticationListener.php b/Http/Firewall/UsernamePasswordFormAuthenticationListener.php index 87a4cf6..22330a8 100644 --- a/Http/Firewall/UsernamePasswordFormAuthenticationListener.php +++ b/Http/Firewall/UsernamePasswordFormAuthenticationListener.php @@ -37,7 +37,7 @@ class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationL /** * {@inheritdoc} */ - public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, $providerKey, AuthenticationSuccessHandlerInterface $successHandler = null, AuthenticationFailureHandlerInterface $failureHandler, array $options = array(), LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, CsrfProviderInterface $csrfProvider = null) + public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = array(), LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, CsrfProviderInterface $csrfProvider = null) { parent::__construct($securityContext, $authenticationManager, $sessionStrategy, $httpUtils, $providerKey, $successHandler, $failureHandler, array_merge(array( 'username_parameter' => '_username', |