diff options
author | Leevi Graham <leevi@newism.com.au> | 2012-10-29 18:23:42 +1100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2012-12-06 14:11:05 +0100 |
commit | 8ad22e67c33c004ee35fa53684954d2894b07dcb (patch) | |
tree | df533dc4858770a3e110e10eb31ed0b57a23f678 /Http/Authentication/DefaultAuthenticationFailureHandler.php | |
parent | b20dc084818bf7f59dd4ff937896f4236821055c (diff) | |
download | symfony-security-8ad22e67c33c004ee35fa53684954d2894b07dcb.zip symfony-security-8ad22e67c33c004ee35fa53684954d2894b07dcb.tar.gz symfony-security-8ad22e67c33c004ee35fa53684954d2894b07dcb.tar.bz2 |
Added failure_path_parameter to mirror target_path_parameter
Diffstat (limited to 'Http/Authentication/DefaultAuthenticationFailureHandler.php')
-rw-r--r-- | Http/Authentication/DefaultAuthenticationFailureHandler.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Http/Authentication/DefaultAuthenticationFailureHandler.php b/Http/Authentication/DefaultAuthenticationFailureHandler.php index 61d77a8..d543745 100644 --- a/Http/Authentication/DefaultAuthenticationFailureHandler.php +++ b/Http/Authentication/DefaultAuthenticationFailureHandler.php @@ -50,9 +50,10 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle $this->logger = $logger; $this->options = array_merge(array( - 'failure_path' => null, - 'failure_forward' => false, - 'login_path' => '/login', + 'failure_path' => null, + 'failure_forward' => false, + 'login_path' => '/login', + 'failure_path_parameter' => '_failure_path' ), $options); } @@ -61,6 +62,10 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle */ public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { + if ($failureUrl = $request->get($this->options['failure_path_parameter'], null, true)) { + $this->options['failure_path'] = $failureUrl; + } + if (null === $this->options['failure_path']) { $this->options['failure_path'] = $this->options['login_path']; } |