fix(auth): guard federated logout on a missing id_token_hint#22
Merged
Conversation
Root fix: every app scaffolded from this template inherited a sign-out bug. Gatekeeper's OIDC end-session endpoint requires id_token_hint and rejects a request without it, so sign-out broke whenever the id token was absent (e.g. after a token refresh, which does not re-issue an id_token). Already patched downstream in herald/backfeed/runa. getIdpLogoutUrl now returns null without an id token, so sign-out falls back to a local-only sign-out instead of redirecting into a 400. Extracted the pure URL builder into lib/auth/idpLogout with unit tests.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Root fix for a sign-out bug every app scaffolded from this template inherited (already patched downstream in herald-app #27/#28, backfeed-app #208, runa-app #86).
Gatekeeper's OIDC end-session endpoint requires
id_token_hint, so sign-out 400s ([query.id_token_hint] Invalid input: expected string, received undefined) whenever the id token is absent (e.g. after a token refresh, which doesn't re-issue an id_token).getIdpLogoutUrlnow returns null without an id token → local-only sign-out fallback. Extracted the pure URL builder intolib/auth/idpLogoutwith unit tests. tsc/biome clean.