diff --git a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php index 46ffde83e6d8..9bbccca884aa 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php @@ -157,11 +157,16 @@ private function startAuthentication(Request $request, AuthenticationException $ $this->logger->debug('Calling Authentication entry point'); } + $this->setTargetPath($request); + + return $this->authenticationEntryPoint->start($request, $authException); + } + + protected function setTargetPath(Request $request) + { // session isn't required when using http basic authentication mechanism for example if ($request->hasSession()) { $request->getSession()->set('_security.target_path', $request->getUri()); } - - return $this->authenticationEntryPoint->start($request, $authException); } }