diff --git a/src/composables/auth/useFirebaseAuthActions.ts b/src/composables/auth/useFirebaseAuthActions.ts index 894ebdabc..3b921baf7 100644 --- a/src/composables/auth/useFirebaseAuthActions.ts +++ b/src/composables/auth/useFirebaseAuthActions.ts @@ -1,5 +1,6 @@ import { FirebaseError } from 'firebase/app' import { ref } from 'vue' +import { useRouter } from 'vue-router' import { useErrorHandling } from '@/composables/useErrorHandling' import { t } from '@/i18n' @@ -15,6 +16,7 @@ import { usdToMicros } from '@/utils/formatUtil' export const useFirebaseAuthActions = () => { const authStore = useFirebaseAuthStore() const toastStore = useToastStore() + const router = useRouter() const { wrapWithErrorHandlingAsync, toastErrorHandler } = useErrorHandling() const accessError = ref(false) @@ -51,6 +53,12 @@ export const useFirebaseAuthActions = () => { detail: t('auth.signOut.successDetail'), life: 5000 }) + + // Redirect to login page if we're on cloud domain + const hostname = window.location.hostname + if (hostname.includes('cloud.comfy.org')) { + await router.push({ name: 'cloud-login' }) + } }, reportError) const sendPasswordReset = wrapWithErrorHandlingAsync(