mirror of
https://github.com/flarum/core.git
synced 2025-08-02 22:47:33 +02:00
Allow custom redirection after logging out
This commit is contained in:
@@ -66,7 +66,9 @@ class LogOutController implements ControllerInterface
|
|||||||
{
|
{
|
||||||
$session = $request->getAttribute('session');
|
$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 ($user = User::find($session->get('user_id'))) {
|
||||||
if (array_get($request->getQueryParams(), 'token') !== $session->get('csrf_token')) {
|
if (array_get($request->getQueryParams(), 'token') !== $session->get('csrf_token')) {
|
||||||
|
Reference in New Issue
Block a user