From 7d55b81d8e972ffdec4c3475b0f342f9c7290b31 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 2 Jan 2016 15:08:50 +1030 Subject: [PATCH] Allow custom redirection after logging out --- framework/core/src/Forum/Controller/LogOutController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/core/src/Forum/Controller/LogOutController.php b/framework/core/src/Forum/Controller/LogOutController.php index 839c2babd..1d95ec771 100644 --- a/framework/core/src/Forum/Controller/LogOutController.php +++ b/framework/core/src/Forum/Controller/LogOutController.php @@ -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')) {