[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
This commit is contained in:
Christian Byrne
2025-09-14 19:44:22 -07:00
committed by GitHub
parent a13eeaea7e
commit 80b1c2aaf7

View File

@@ -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(