mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 14:45:36 +00:00
## Summary Extract auth-routing logic (`getAuthHeaderOrThrow`, `getFirebaseAuthHeaderOrThrow`) from `workspaceApi.ts` into `authStore.ts`, eliminating a layering violation where the workspace API re-implemented auth header resolution. ## Changes - **What**: Moved `getAuthHeaderOrThrow` and `getFirebaseAuthHeaderOrThrow` from `workspaceApi.ts` to `authStore.ts`. `workspaceApi.ts` now calls through `useAuthStore()` instead of re-implementing token resolution. Added tests for the new methods in `authStore.test.ts`. Updated `authStoreMock.ts` with the new methods. - **Files**: 4 files changed ## Review Focus - The `getAuthHeaderOrThrow` / `getFirebaseAuthHeaderOrThrow` methods throw `AuthStoreError` (auth domain error) — callers in workspace can catch and re-wrap if needed - `workspaceApi.ts` is simplified by ~19 lines ## Stack PR 2/5: #10483 → **→ This PR** → #10485 → #10486 → #10487