Repository navigation
Always clear the session cookie on logout - #73788
Merged
Merged
Conversation
When the auth manager supplies an external logout URL (FAB, Keycloak), ``/auth/logout`` revoked the token and redirected without deleting the ``_token`` cookie, so the revocation was the only thing ending the local session. ``revoke_token`` also caught every failure -- including a failure to record the revocation -- and logged it as a warning, so a revocation that did not happen looked the same as one that did. Delete the cookie on every logout path, and log a failure to record the revocation of a valid token as an error, separately from a token that does not validate and needs no revocation. Generated-by: Claude Opus 5
potiuk
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar,
shubhamraj-git and
vincbeck
as code owners
September 27, 2026 12:23
vincbeck
approved these changes
Sep 28, 2026
eladkal
approved these changes
Sep 29, 2026
pierrejeambrun
approved these changes
Oct 1, 2026
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.
When the auth manager supplies an external logout URL (FAB, Keycloak),
/auth/logoutrevoked the token and redirected without deleting the_tokencookie, so the revocation was the only thing ending the local session.revoke_tokenalso caught every failure — including a failure to record the revocation — and logged it as a warning, so a revocation that did not happen looked the same as one that did._tokencookie is now deleted on every logout path, including the redirect to an external logout URL. Neither the FAB nor the Keycloak logout route reads it (Keycloak uses the separate ID-token cookie).revoke_tokenseparates a token that does not validate (already unusable, logged as a warning, as before) from a valid token whose revocation cannot be recorded, which stays usable until it expires and is now logged as an error.The new route tests stub the refresh middleware so that only the logout route can clear the cookie.
🤖 Generated with Claude Code