Skip to content

feat(auth): add buildIdpLogoutUrl helper#13

Merged
coopbri merged 1 commit into
masterfrom
feat/idp-logout-helper
Jul 10, 2026
Merged

feat(auth): add buildIdpLogoutUrl helper#13
coopbri merged 1 commit into
masterfrom
feat/idp-logout-helper

Conversation

@coopbri

@coopbri coopbri commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Adds a shared, pure buildIdpLogoutUrl to the /auth subpath so the Gatekeeper OIDC end-session (federated logout) URL logic lives in one place instead of being copied per app.

Why

A sign-out bug (Gatekeeper's end-session endpoint requires id_token_hint and 400s without it) was just fixed in herald/backfeed/runa + the tanstack-start template with identical per-app copies of this helper. This is the canonical home; those apps will import from here.

Behavior

Returns null unless every part is present, including the id token — so a caller lacking the id token falls back to a local-only sign-out rather than redirecting into a validation error. Pure/config-injected, with unit tests (full URL when present; null without an id token; null when any config part is missing; url-encoding).

Build note

The committed build/ was stale for the prior OIDC sign-up change (createOmniOAuthConfig) — running bun run build re-synced build/index.js + build/auth/oauth.d.ts alongside adding the new build/auth/idpLogout.*. No build/react (or other entry) churn; verified no jsxDEV in the build. 285 tests pass; tsc/biome/knip clean.

Shared, pure builder for the Gatekeeper OIDC end-session (federated logout) URL,
so the id_token_hint guard lives in one place instead of being copied per app.
Returns null unless every part is present, including the id token: the endpoint
requires id_token_hint, so a caller without it must fall back to a local-only
sign-out rather than redirect into a validation error. Exported from the /auth
subpath with unit tests.

NB: the build also re-syncs the committed output for the prior OIDC sign-up
change (createOmniOAuthConfig), which was stale in build/.
@coopbri
coopbri merged commit cae47bc into master Jul 10, 2026
3 of 4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant