Allow custom redirection after logging out

This commit is contained in:
Toby Zerner 2016-01-02 15:08:50 +10:30
parent 46818ccd94
commit f7709aff95

View File

@ -66,7 +66,9 @@ class LogOutController implements ControllerInterface
{
$session = $request->getAttribute('session');
$response = new RedirectResponse($this->app->url());
$url = array_get($request->getQueryParams(), 'return', $this->app->url());
$response = new RedirectResponse($url);
if ($user = User::find($session->get('user_id'))) {
if (array_get($request->getQueryParams(), 'token') !== $session->get('csrf_token')) {