feat: implement per-tab workspace authentication#8069
feat: implement per-tab workspace authentication#8069christian-byrne wants to merge 1 commit intomainfrom
Conversation
- Add useWorkspaceAuth composable for workspace token management - Add WorkspaceSwitcher component to topbar for switching workspaces - Add WorkspaceSelector dropdown component - Update firebaseAuthStore.getAuthHeader() to prioritize workspace tokens - Add workspace types aligned with backend API (cloud PR #1995) Key features: - Per-tab workspace isolation via sessionStorage - Auto-refresh tokens 5 minutes before expiry - Unsaved changes confirmation before switching - Firebase token exchange for workspace-scoped JWT Co-authored-by: anthropic/claude <noreply@anthropic.com> Amp-Thread-ID: https://ampcode.com/threads/T-019bbf2e-fe27-72da-a997-cb99968d8e61 Co-authored-by: Amp <amp@ampcode.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright Tests:
|
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/15/2026, 02:35:27 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
christian-byrne
left a comment
There was a problem hiding this comment.
The UI is just for being able to test (temporary).
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.34 MB (baseline 3.34 MB) • 🔴 +1.66 kBMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 1.17 MB (baseline 1.15 MB) • 🔴 +17.1 kBGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.66 kB (baseline 6.66 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 372 kB (baseline 372 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 209 kB (baseline 209 kB) • ⚪ 0 BReusable component library chunks
Status: 8 added / 8 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 1.41 kB (baseline 1.41 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 9.34 MB (baseline 9.34 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 5.25 MB (baseline 5.25 MB) • ⚪ 0 BBundles that do not match a named category
Status: 16 added / 16 removed |
|
Replaced by #8073 |
Summary
Implements per-tab workspace authentication that allows users to work in different workspaces in different browser tabs.
Changes
New Files
src/platform/auth/workspace/useWorkspaceAuth.ts- Core composable for workspace token managementsrc/platform/auth/workspace/useWorkspaceSwitch.ts- Composable for switching with unsaved changes confirmationsrc/platform/auth/workspace/components/WorkspaceSwitcher.vue- Topbar button with popoversrc/platform/auth/workspace/components/WorkspaceSelector.vue- Dropdown workspace listsrc/types/workspaceTypes.ts- Type definitions aligned with backend APIModified Files
src/stores/firebaseAuthStore.ts-getAuthHeader()now prioritizes workspace tokens over Firebase tokenssrc/components/TopMenuSection.vue- Added WorkspaceSwitcher to topbarsrc/locales/en/main.json- Added workspace-related translationsKey Features
API Alignment
This PR is aligned with the backend API from cloud PR #1995:
POST /api/auth/token- Exchange Firebase token for workspace tokenGET /api/workspaces- List user's workspacesworkspace_id(snake_case)token,expires_at(ISO 8601),role,permissionsTesting
TODO (before merging)
┆Issue is synchronized with this Notion page by Unito