fix: Refresh Panel globals after logout - #8508
Merged
Merged
Conversation
afbora
requested changes
Sep 22, 2026
afbora
left a comment
Member
There was a problem hiding this comment.
Same issue happens on code login: the logout() call inside verifyChallenge() removes the token, but LoginCodeForm only calls this.$reload() without asking for globals. Changing it to this.$reload({ globals: ["$system", "$translation"] }) like in LoginForm fixes it.
Member
Author
|
@afbora Added a fix for that too |
afbora
approved these changes
Sep 22, 2026
afbora
left a comment
Member
There was a problem hiding this comment.
You might want to add a regression test for LoginCodeForm. Still LGTM anyway 👍
Member
Author
|
@afbora I will look into that for v6 which has rewritten that code completely, so the merge forward will be interesting anyways. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review
Description
Auth::logout()removeskirby.csrffrom the session since v5.6.0. The logout view then redirects withPanel::go('login'), which the Panel follows in place, so the browser keeps$system.csrffrom before the logout while the session no longer has a token at all.The logout view now asks for the globals it invalidated:
Panel::go('login?_globals=$system,$translation').I didn't go with
Panel::go(url: 'login', refresh: 0):Response::refresh()sends a 302 with aRefreshheader and noLocation, so the Panel's fetch can't follow it, falls through toRedirectError, and bounces the browser back to/panel/logout.Changelog
🐛 Bug fixes
"Invalid CSRF token" when logging back in after logging out of the Panel #8502
_globals,_json,_only,_pretty) no longer show up in the Panel URLFor review team