From 80b1c2aaf7784208abfd36185dae882ff3305342 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sun, 14 Sep 2025 19:44:22 -0700 Subject: [PATCH] [feat] Redirect to login page after logout on cloud domains (#5570) - Add router navigation to cloud-login after successful logout - Check hostname to ensure we only redirect on cloud domains - Preserves existing toast notification and error handling --- src/composables/auth/useFirebaseAuthActions.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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(