fix(web): persist workspace ID in localStorage from auth flow #546

Closed
jason.woltje wants to merge 1 commits from fix/workspace-id-persistence into main

1 Commits

Author SHA1 Message Date
61179782a9 fix(web): persist workspace ID in localStorage from auth flow
Some checks failed
ci/woodpecker/push/web Pipeline failed
Set mosaic-workspace-id in localStorage when the auth session loads
successfully, so useWorkspaceId and apiRequest can read it without a
separate fetch. Uses currentWorkspaceId when available, falls back to
workspaceId. Clears the key on sign-out to prevent stale workspace
context on subsequent unauthenticated requests. Adds four targeted unit
tests to auth-context.test.tsx covering each persistence scenario.

Closes SS-WS-003

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 05:19:31 -06:00