fix(apollo): logout on stale Auth0 token errors #2887

Merged
argoyle merged 1 commits from fix/logout-on-stale-auth into main 2026-05-05 17:37:01 +00:00
Owner

Summary

  • When getAccessTokenSilently rejects with login_required, invalid_grant, missing_refresh_token, consent_required, or interaction_required, call auth0.logout({ openUrl: false })
  • Keeps the UI honest: previously the app showed the user as logged in while every authenticated query silently failed, until they manually logged out and back in

Why

Paired with the backend change to make Origins tolerate missing subjects, this prevents the misleading "logged in but nothing works" state seen on mobile cold starts.

Test plan

  • npm run lint
  • Verify on phone: stale auth flips UI to logged-out instead of looking logged-in with empty events
## Summary - When `getAccessTokenSilently` rejects with `login_required`, `invalid_grant`, `missing_refresh_token`, `consent_required`, or `interaction_required`, call `auth0.logout({ openUrl: false })` - Keeps the UI honest: previously the app showed the user as logged in while every authenticated query silently failed, until they manually logged out and back in ## Why Paired with the backend change to make `Origins` tolerate missing subjects, this prevents the misleading "logged in but nothing works" state seen on mobile cold starts. ## Test plan - [x] `npm run lint` - [ ] Verify on phone: stale auth flips UI to logged-out instead of looking logged-in with empty events
argoyle added 1 commit 2026-05-05 17:30:43 +00:00
fix(apollo): logout on stale Auth0 token errors
dancefinder-app / build (pull_request) Successful in 2m57s
dancefinder-app / deploy-prod (pull_request) Has been skipped
00d6c08db2
When getAccessTokenSilently fails with login_required, invalid_grant,
missing_refresh_token, consent_required or interaction_required, log
the user out (without redirect) so the UI reflects reality instead of
appearing logged in while every authenticated query silently fails.
argoyle scheduled this pull request to auto merge when all checks succeed 2026-05-05 17:31:33 +00:00
argoyle merged commit 189e35acf8 into main 2026-05-05 17:37:01 +00:00
argoyle deleted branch fix/logout-on-stale-auth 2026-05-05 17:37:02 +00:00
Sign in to join this conversation.