diff options
author | Christophe Coevoet <stof@notk.org> | 2011-06-06 21:38:57 +0200 |
---|---|---|
committer | Christophe Coevoet <stof@notk.org> | 2011-06-06 21:44:53 +0200 |
commit | d39b5cc88441b4d0966f204a780fe1cb9663b6ab (patch) | |
tree | 04899e704d2a4593d1b648779adee992765bae9c /Http/EntryPoint | |
parent | 135e8126ffe15e4efc73def511e9fdefea69552d (diff) | |
download | symfony-security-d39b5cc88441b4d0966f204a780fe1cb9663b6ab.zip symfony-security-d39b5cc88441b4d0966f204a780fe1cb9663b6ab.tar.gz symfony-security-d39b5cc88441b4d0966f204a780fe1cb9663b6ab.tar.bz2 |
Added the support of the locale in the login path and the check path
Diffstat (limited to 'Http/EntryPoint')
-rw-r--r-- | Http/EntryPoint/FormAuthenticationEntryPoint.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Http/EntryPoint/FormAuthenticationEntryPoint.php b/Http/EntryPoint/FormAuthenticationEntryPoint.php index 12f077f..057de2d 100644 --- a/Http/EntryPoint/FormAuthenticationEntryPoint.php +++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php @@ -48,10 +48,11 @@ 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); + return $this->httpKernel->handle(Request::create($path), 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); } } |