mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 15:40:10 +00:00
[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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user