Repository navigation
fix(oidc-auth): delete domain-scoped session cookie on invalidation - #2175
Open
ChethankumarGS wants to merge 3 commits into
Open
ChethankumarGS wants to merge 3 commits into
ChethankumarGS wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 9338711 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Ensure the domain-scoped session cookie is deleted on all invalidation paths, not just in revokeSession(). This change addresses issues with cookie identity and ensures consistent behavior across invalidation scenarios.
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.
Follow-up to #1490. That fix covered
revokeSession(), but the other session-invalidation paths still calldeleteCookie()without the configuredOIDC_COOKIE_DOMAIN. A cookie's identity is its (name, domain, path) triple, so the domain-scoped session cookie - the oneupdateAuth()actually sets - survives invalidation and the session stays alive.Changes:
deleteSessionCookie()helper (same delete-both pattern asrevokeSession()) and use it ingetAuth()(invalid JWT, empty refresh token, rejected refresh grant), theoidcAuthMiddleware()catch block, andrevokeSession()itselfstate/nonce/code_verifier/continueflow cookies inprocessOAuthCallback()with the domain they were set withnext(), so it matchesupdateAuth()instead of creating a divergent host-only cookieTests: three regression tests covering invalidation with
OIDC_COOKIE_DOMAINset (invalid JWT, rejected refresh grant, renewal without a host-only duplicate). All three fail on main and pass with the fix; the full@hono/oidc-authsuite passes (45 tests).Fixes #2174