Skip to content

fix(graphql): guard the 401 sign-out path in graphqlFetch - #211

Merged
coopbri merged 1 commit into
masterfrom
fix/graphqlfetch-401-guard
Jul 11, 2026
Merged

fix(graphql): guard the 401 sign-out path in graphqlFetch#211
coopbri merged 1 commit into
masterfrom
fix/graphqlfetch-401-guard

Conversation

@coopbri

@coopbri coopbri commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Aligns graphqlFetch's error handling on the herald/vortex reference: guards error.response (network errors are not ClientErrors and must not trigger a redirect / TypeError), signs out on a genuine 401 OR UNAUTHENTICATED code, and clears the session server-side before redirecting (was a bare window.location.href='/' on any 401). Part of the omni eager-logout sweep. tsc/biome clean.

The catch block did `error.response.status === 401 -> window.location.href = "/"`
without checking `error.response` exists and without a clean sign-out. Align on
the herald/vortex pattern: guard the response, sign out on a genuine 401 OR an
UNAUTHENTICATED error code, clear the session server-side, then redirect.
@coopbri
coopbri merged commit 842ac97 into master Jul 11, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 11, 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