Skip to content

fix: persist auth across browser windows using localStorage#557

Merged
chrisns merged 3 commits intomainfrom
fix/persist-auth-across-windows
Mar 20, 2026
Merged

fix: persist auth across browser windows using localStorage#557
chrisns merged 3 commits intomainfrom
fix/persist-auth-across-windows

Conversation

@chrisns
Copy link
Member

@chrisns chrisns commented Mar 20, 2026

Summary

  • Switch JWT token storage from sessionStorage to localStorage so users stay signed in when opening new browser windows or tabs
  • Add cross-tab sync via the storage event so sign-in/out in one tab automatically updates all other open tabs
  • Keep OAuth flow state (return URL, welcome-back flag) in sessionStorage since these are correctly per-tab

Test plan

  • All 245 unit tests pass (src/try/auth and src/try/api)
  • Manual: sign in, open new window — should remain signed in
  • Manual: sign out in one tab — other tabs should update to signed-out state
  • Manual: token expiry still clears auth state correctly
  • E2E: localStorage persistence tests updated and passing

chrisns added 2 commits March 20, 2026 19:18
Switch JWT token storage from sessionStorage to localStorage so users
stay signed in when opening new windows or tabs. Add cross-tab sync
via the storage event so sign-in/out in one tab updates all others.
Update all E2E and accessibility tests to read/write the JWT token
from localStorage instead of sessionStorage, matching the production
code change.
@chrisns chrisns enabled auto-merge March 20, 2026 19:45
- Fix try-flow.spec.ts to use localStorage for JWT token
- Simplify cross-navigation persistence test to avoid Playwright quirk
  with /try page bundle initialization
@chrisns chrisns added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 7a40c93 Mar 20, 2026
22 checks passed
@chrisns chrisns deleted the fix/persist-auth-across-windows branch March 20, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant