diff --git a/src/composables/useFeatureFlags.ts b/src/composables/useFeatureFlags.ts index 136b7ccd1f..a3d2e97676 100644 --- a/src/composables/useFeatureFlags.ts +++ b/src/composables/useFeatureFlags.ts @@ -95,10 +95,11 @@ export function useFeatureFlags() { ) }, get teamWorkspacesEnabled() { - return ( - remoteConfig.value.team_workspaces_enabled ?? - api.getServerFeature(ServerFeatureFlag.TEAM_WORKSPACES_ENABLED, false) - ) + return true + // return ( + // remoteConfig.value.team_workspaces_enabled ?? + // api.getServerFeature(ServerFeatureFlag.TEAM_WORKSPACES_ENABLED, false) + // ) } }) diff --git a/src/platform/auth/session/useSessionCookie.ts b/src/platform/auth/session/useSessionCookie.ts index 4943616e08..295e2ab264 100644 --- a/src/platform/auth/session/useSessionCookie.ts +++ b/src/platform/auth/session/useSessionCookie.ts @@ -1,3 +1,4 @@ +import { useFeatureFlags } from '@/composables/useFeatureFlags' import { isCloud } from '@/platform/distribution/types' import { api } from '@/scripts/api' import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore' @@ -18,15 +19,13 @@ export const useSessionCookie = () => { const createSession = async (): Promise => { if (!isCloud) return + const { flags } = useFeatureFlags() try { const authStore = useFirebaseAuthStore() let authHeader: Record - // TODO: Use remoteConfig.value.team_workspaces_enabled when backend enables the flag - // Currently hardcoded to match router.ts behavior - const teamWorkspacesEnabled = true - if (teamWorkspacesEnabled) { + if (flags.teamWorkspacesEnabled) { const firebaseToken = await authStore.getIdToken() if (!firebaseToken) { console.warn( diff --git a/src/router.ts b/src/router.ts index 959c2ad8bf..a8ffad40b5 100644 --- a/src/router.ts +++ b/src/router.ts @@ -184,9 +184,8 @@ if (isCloud) { // Initialize workspace context for logged-in users navigating to root // This must happen before the app loads to ensure workspace context is ready - // TODO: Use flags.teamWorkspacesEnabled when backend enables the flag - const teamWorkspacesEnabled = true - if (to.path === '/' && teamWorkspacesEnabled) { + + if (to.path === '/' && flags.teamWorkspacesEnabled) { const { useTeamWorkspaceStore } = await import('@/platform/workspace/stores/teamWorkspaceStore') const workspaceStore = useTeamWorkspaceStore() diff --git a/src/stores/firebaseAuthStore.ts b/src/stores/firebaseAuthStore.ts index e32438b5a2..9433182406 100644 --- a/src/stores/firebaseAuthStore.ts +++ b/src/stores/firebaseAuthStore.ts @@ -30,6 +30,7 @@ import { useDialogService } from '@/services/dialogService' import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore' import type { AuthHeader } from '@/types/authTypes' import type { operations } from '@/types/comfyRegistryTypes' +import { useFeatureFlags } from '@/composables/useFeatureFlags' type CreditPurchaseResponse = operations['InitiateCreditPurchase']['responses']['201']['content']['application/json'] @@ -57,6 +58,8 @@ export class FirebaseAuthStoreError extends Error { } export const useFirebaseAuthStore = defineStore('firebaseAuth', () => { + const { flags } = useFeatureFlags() + // State const loading = ref(false) const currentUser = ref(null) @@ -172,10 +175,7 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => { * - null if no authentication method is available */ const getAuthHeader = async (): Promise => { - // TODO: Use remoteConfig.value.team_workspaces_enabled when backend enables the flag - // Currently hardcoded to match router.ts behavior - const teamWorkspacesEnabled = true - if (teamWorkspacesEnabled) { + if (flags.teamWorkspacesEnabled) { const workspaceToken = sessionStorage.getItem( WORKSPACE_STORAGE_KEYS.TOKEN )