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
Owner

Fix useWorkspaceId console warning by persisting workspace ID during app initialization. Closes SS-WS-003 (issue #534)

Fix useWorkspaceId console warning by persisting workspace ID during app initialization. Closes SS-WS-003 (issue #534)
jason.woltje added 1 commit 2026-02-27 11:20:33 +00:00
fix(web): persist workspace ID in localStorage from auth flow
Some checks failed
ci/woodpecker/push/web Pipeline failed
61179782a9
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>
jason.woltje closed this pull request 2026-02-27 11:25:00 +00:00
jason.woltje reopened this pull request 2026-02-27 11:38:29 +00:00
jason.woltje closed this pull request 2026-02-27 11:43:48 +00:00
Some checks failed
ci/woodpecker/push/web Pipeline failed

Pull request closed

Sign in to join this conversation.