fix: a signed-in session follows the account it belongs to - #947
Merged
blaipr merged 1 commit intoSep 24, 2026
Merged
Conversation
blaipr
deleted the
fix/a-signed-in-session-follows-the-account-it-belongs-to
branch
September 24, 2026 18:37
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.
The web session carried everything an authorisation decision reads, copied in once at sign-in:
isAdminAppandisAdminAccIt never looked at them again. The profile was reloaded only on a full browser reload, and this app is AJAX-driven. So an administrator who revoked someone's admin rights, moved them to another group or tightened their profile changed nothing for the session that user was already in. The timeout is measured from the last request, so an actively used session kept the old privileges indefinitely.
The API has always rebuilt the user and profile from the database on every request (
Api::setupUser()). The web already re-read the user's row on every request, but only to end the session of a disabled account (#834).Change
Initnow uses that same per-request read to refresh the session:UserDto::fromModel(), exactly what sign-in stores) and its profile is re-read.Tests
InitSessionTest:isAdminApp/isAdminAccand moved group follows the row.The first two fail without the fix. The existing "enabled account survives" fixture row now carries its login, since the session is now rebuilt from it.
The integration suite is green with no warnings. That was checked because the integration harness answers a per-request user read with its fixture row, and a behaviour change there has previously shown up only as warnings.