diff options
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']; } |