singularity-forge/web/components/gsd
Andrew 6cc6c36a69 fix(web): auth token gate — synthetic 401 on missing token, unauthenticated boot state, and recovery screen (#2740)
When `gsd --web` is opened without the #token= hash fragment (manual URL
entry, bookmark, new tab), `authenticatedFetch` previously fell through to
a naked `fetch()` that always returned 401, flooding the console with
cascading errors and leaving the UI in a broken state with no recovery path.

Three changes:

1. `web/lib/auth.ts` — `authFetch()` now returns a synthetic 401 Response
   when `getAuthToken()` returns null instead of delegating to bare fetch.
   This makes missing-token failures consistent and immediately catchable
   by all callers without a network round-trip.

2. `web/lib/gsd-workspace-store.tsx` — Added `"unauthenticated"` to
   `WorkspaceStatus`. `refreshBoot()` now detects a 401 response from
   /api/boot and patches `bootStatus` to `"unauthenticated"` instead of
   throwing a generic error. This is a distinct state — not an error worth
   retrying, but a configuration problem the user must resolve.

3. `web/components/gsd/app-shell.tsx` — Added an early-return guard that
   renders a minimal "Authentication Required" screen when
   `bootStatus === "unauthenticated"`. The screen explains the problem and
   tells users to copy the full terminal URL (including `#token=…`) or
   restart with `gsd --web`.

Fixes #2731
2026-03-26 16:17:12 -06:00
..
onboarding feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -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): auth token gate — synthetic 401 on missing token, unauthenticated boot state, and recovery screen (#2740) 2026-03-26 16:17:12 -06:00
chat-mode.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
code-editor.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
command-surface.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
dashboard.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
diagnostics-panels.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -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): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -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): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -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): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
loading-skeletons.tsx feat: managed RTK integration with opt-in preference and web UI toggle (#2620) 2026-03-26 09:33:07 -06:00
main-session-terminal.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
onboarding-gate.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
project-welcome.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
projects-view.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
remaining-command-panels.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
roadmap.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
scope-badge.tsx feat: add parallel quality gate evaluation with evaluating-gates phase 2026-03-26 14:51:38 +10:00
settings-panels.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
shell-terminal.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
sidebar.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00
status-bar.tsx feat(web): make web UI mobile responsive (#2354) 2026-03-25 00:07:39 -06:00
terminal.tsx feat(web): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -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): Dark mode contrast — raise token floor and flatten opacity tier system (#2734) 2026-03-26 16:17:03 -06:00