mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 06:47:33 +00:00
Carry over invite code param for logout action
The invite code page starts with a logout action, but we were dropping the invite code query param. This preserves it.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { FirebaseError } from 'firebase/app'
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { useErrorHandling } from '@/composables/useErrorHandling'
|
||||
import { t } from '@/i18n'
|
||||
@@ -16,6 +16,7 @@ import { usdToMicros } from '@/utils/formatUtil'
|
||||
export const useFirebaseAuthActions = () => {
|
||||
const authStore = useFirebaseAuthStore()
|
||||
const toastStore = useToastStore()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const { wrapWithErrorHandlingAsync, toastErrorHandler } = useErrorHandling()
|
||||
|
||||
@@ -57,7 +58,12 @@ export const useFirebaseAuthActions = () => {
|
||||
// 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' })
|
||||
if (route.query.inviteCode) {
|
||||
const inviteCode = route.query.inviteCode
|
||||
await router.push({ name: 'cloud-login', query: { inviteCode } })
|
||||
} else {
|
||||
await router.push({ name: 'cloud-login' })
|
||||
}
|
||||
}
|
||||
}, reportError)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user