singularity-forge/web/components/gsd
Tom Boucher f4db25b9b8 fix(web): persist auth token in sessionStorage to survive page refreshes (#1877)
Next.js 16 auto-detects web/proxy.ts as middleware, gating all /api/*
routes behind bearer token validation. The token was only cached in
memory (lost on page refresh) and extracted from the URL hash fragment
(cleared after first extraction). This caused 401 errors on page
refresh and broke the sendBeacon shutdown call which cannot set
custom headers.

Changes:
- Persist the auth token to sessionStorage after extracting from the
  URL fragment so it survives page refreshes within the same tab
- Fall back to sessionStorage when the URL hash is absent (refresh,
  bookmark without hash)
- Pass the auth token as a _token query parameter in the sendBeacon
  shutdown call since sendBeacon cannot set Authorization headers
- Add regression tests for token persistence, sessionStorage fallback,
  and sendBeacon authentication

Fixes #1851

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 15:25:27 -06:00
..
onboarding feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
activity-view.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
app-shell.tsx fix(web): persist auth token in sessionStorage to survive page refreshes (#1877) 2026-03-21 15:25:27 -06:00
chat-mode.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
code-editor.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
command-surface.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
dashboard.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
diagnostics-panels.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
dual-terminal.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
file-content-viewer.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
files-view.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
focused-panel.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
guided-dialog.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
knowledge-captures-panel.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
loading-skeletons.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
main-session-terminal.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
onboarding-gate.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
project-welcome.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
projects-view.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
remaining-command-panels.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
roadmap.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
scope-badge.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
settings-panels.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
shell-terminal.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
sidebar.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
status-bar.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
terminal.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
update-banner.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00
visualizer-view.tsx feat(web): browser-based web interface (#1717) 2026-03-21 12:16:54 -06:00