diff options
Diffstat (limited to 'Http/EntryPoint/FormAuthenticationEntryPoint.php')
-rw-r--r-- | Http/EntryPoint/FormAuthenticationEntryPoint.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Http/EntryPoint/FormAuthenticationEntryPoint.php b/Http/EntryPoint/FormAuthenticationEntryPoint.php index 12f077f..6301606 100644 --- a/Http/EntryPoint/FormAuthenticationEntryPoint.php +++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php @@ -48,10 +48,13 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface */ public function start(Request $request, AuthenticationException $authException = null) { + $path = str_replace('{_locale}', $request->getSession()->getLocale(), $this->loginPath); if ($this->useForward) { - return $this->httpKernel->handle(Request::create($this->loginPath), HttpKernelInterface::SUB_REQUEST); + $subRequest = Request::create($path, 'get', array(), $request->cookies->all(), array(), $request->server->all()); + + return $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST); } - return new RedirectResponse(0 !== strpos($this->loginPath, 'http') ? $request->getUriForPath($this->loginPath) : $this->loginPath, 302); + return new RedirectResponse(0 !== strpos($path, 'http') ? $request->getUriForPath($path) : $path, 302); } } |