mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Allow custom redirection after logging out
This commit is contained in:
parent
1fe6ff1b6f
commit
7d55b81d8e
|
@ -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')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user