Repository navigation
fix(auth): read ban and deletion live on every authenticated request - #150
Merged
Merged
Conversation
The access token's is_banned claim is fixed at issue time, so a ban or an admin soft-delete only took effect at the next refresh. authenticate now reads the account's standing together with the login session check, and ban / soft-delete close the user's open streams and sockets.
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.
authenticatenow reads the account's ban flag anddeleted_atin the same query as the login-session liveness check it already ran per request (one query, sid-less tokens included), and overrides the token'sis_bannedclaim with the live value:403 bannedon the next request instead of after the next refresh; an unban applies immediately the same way401on the next requestban_userand the admin soft delete callnotify_sessions_reset, so the user's open sync streams and terminal sockets closeTests: new cases in
routes::authandroutes::admin; two middleware tests moved from a dead pool to a seeded user since the middleware now always reads the account. Full suite and clippy clean.