|
@@ -69,7 +69,10 @@ class LogoutListener implements ListenerInterface
|
|
{
|
|
{
|
|
$request = $event->getRequest();
|
|
$request = $event->getRequest();
|
|
|
|
|
|
- if ($this->logoutPath !== $request->getPathInfo()) {
|
|
|
|
|
|
+ $logoutPath = str_replace('{_locale}', $request->getSession()->getLocale(), $this->logoutPath);
|
|
|
|
+ $targetUrl = str_replace('{_locale}', $request->getSession()->getLocale(), $this->targetUrl);
|
|
|
|
+
|
|
|
|
+ if ($logoutPath !== $request->getPathInfo()) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -80,7 +83,7 @@ class LogoutListener implements ListenerInterface
|
|
throw new \RuntimeException('Logout Success Handler did not return a Response.');
|
|
throw new \RuntimeException('Logout Success Handler did not return a Response.');
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- $response = new RedirectResponse(0 !== strpos($this->targetUrl, 'http') ? $request->getUriForPath($this->targetUrl) : $this->targetUrl, 302);
|
|
|
|
|
|
+ $response = new RedirectResponse(0 !== strpos($targetUrl, 'http') ? $request->getUriForPath($targetUrl) : $targetUrl, 302);
|
|
}
|
|
}
|
|
|
|
|
|
// handle multiple logout attempts gracefully
|
|
// handle multiple logout attempts gracefully
|