summaryrefslogtreecommitdiffstats
path: root/Http/Authentication/DefaultAuthenticationFailureHandler.php
diff options
context:
space:
mode:
authorLeevi Graham <leevi@newism.com.au>2012-10-29 18:23:42 +1100
committerFabien Potencier <fabien.potencier@gmail.com>2012-12-06 14:11:05 +0100
commit8ad22e67c33c004ee35fa53684954d2894b07dcb (patch)
treedf533dc4858770a3e110e10eb31ed0b57a23f678 /Http/Authentication/DefaultAuthenticationFailureHandler.php
parentb20dc084818bf7f59dd4ff937896f4236821055c (diff)
downloadsymfony-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.php11
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'];
}