mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 05:13:37 +08:00
Preserve return URL when confirming logout
This commit is contained in:
parent
ea2fc1ff8a
commit
ba769e0c7e
|
@ -107,7 +107,8 @@ class LogOutController implements ControllerInterface
|
||||||
if (array_get($request->getQueryParams(), 'token') !== $csrfToken) {
|
if (array_get($request->getQueryParams(), 'token') !== $csrfToken) {
|
||||||
$view = $this->view->make('flarum.forum::log-out')
|
$view = $this->view->make('flarum.forum::log-out')
|
||||||
->with('csrfToken', $csrfToken)
|
->with('csrfToken', $csrfToken)
|
||||||
->with('forumTitle', $this->settings->get('forum_title'));
|
->with('forumTitle', $this->settings->get('forum_title'))
|
||||||
|
->with('return', array_get($request->getQueryParams(), 'return'));
|
||||||
|
|
||||||
return new HtmlResponse($view->render());
|
return new HtmlResponse($view->render());
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<p>{{ $translator->trans('core.views.log_out.log_out_confirmation', ['{forum}' => $forumTitle]) }}</p>
|
<p>{{ $translator->trans('core.views.log_out.log_out_confirmation', ['{forum}' => $forumTitle]) }}</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="{{ $url->toRoute('logout') }}?token={{ $csrfToken }}" class="button">
|
<a href="{{ $url->toRoute('logout') }}?token={{ $csrfToken }}@if ($return)&return={{ urlencode($return) }}@endif" class="button">
|
||||||
{{ $translator->trans('core.views.log_out.log_out_button') }}
|
{{ $translator->trans('core.views.log_out.log_out_button') }}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user