Skip to content

[backport cloud/1.37] feat: add per-tab workspace authentication infrastructure#8089

Merged
simula-r merged 1 commit intocloud/1.37from
backport-8073-to-cloud-1.37
Jan 22, 2026
Merged

[backport cloud/1.37] feat: add per-tab workspace authentication infrastructure#8089
simula-r merged 1 commit intocloud/1.37from
backport-8073-to-cloud-1.37

Conversation

@comfy-pr-bot
Copy link
Member

@comfy-pr-bot comfy-pr-bot commented Jan 16, 2026

Backport of #8073 to cloud/1.37

Automatically created by backport workflow.

┆Issue is synchronized with this Notion page by Unito

## Summary
Add workspace authentication composables and types for per-tab workspace
isolation. This infrastructure enables users to work in different
workspaces in different browser tabs.

## Changes
- **useWorkspaceAuth composable** - workspace token management
- Exchange Firebase token for workspace-scoped JWT via `POST
/api/auth/token`
  - Auto-refresh tokens 5 minutes before expiry
  - Per-tab sessionStorage caching
- **useWorkspaceSwitch composable** - workspace switching with unsaved
changes confirmation
- **WorkspaceWithRole/WorkspaceTokenResponse types** - aligned with
backend API
- **firebaseAuthStore.getAuthHeader()** - prioritizes workspace tokens
over Firebase tokens
- **useSessionCookie** - uses Firebase token directly (getIdToken())
since getAuthHeader() now returns workspace token

## Backend Dependency
- `POST /api/auth/token` - exchange Firebase token for workspace token
- `GET /api/workspaces` - list user's workspaces

## Related
- #6295

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8073-feat-add-per-tab-workspace-authentication-infrastructure-2e96d73d3650816c8cf9dae9c330aebb)
by [Unito](https://www.unito.io)

---------

Co-authored-by: anthropic/claude <noreply@anthropic.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Simula_r <18093452+simula-r@users.noreply.github.com>
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Jan 16, 2026
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jan 16, 2026
@github-actions
Copy link

github-actions bot commented Jan 16, 2026

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 01/16/2026, 01:26:54 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

🎭 Playwright Tests: ⚠️ Passed with flaky tests

Results: 502 passed, 0 failed, 2 flaky, 8 skipped (Total: 512)

❌ Failed Tests

📊 Browser Reports
  • chromium: View Report (✅ 492 / ❌ 0 / ⚠️ 1 / ⏭️ 8)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 7 / ❌ 0 / ⚠️ 1 / ⏭️ 0)

@christian-byrne
Copy link
Contributor

christian-byrne commented Jan 16, 2026

Might want to wait to merge this until all Simple (Linear) Mode backports/fixes are likely to be done/merged. Not a huge deal though, since it is all feature-flagged.

@simula-r simula-r merged commit abb2b15 into cloud/1.37 Jan 22, 2026
34 checks passed
@simula-r simula-r deleted the backport-8073-to-cloud-1.37 branch January 22, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants