From 529a4de583d3f7b9a7c78bb74bc25ac71d64bd47 Mon Sep 17 00:00:00 2001 From: Deep Roy Date: Fri, 3 Oct 2025 18:27:44 -0400 Subject: [PATCH] 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. --- src/composables/auth/useFirebaseAuthActions.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/composables/auth/useFirebaseAuthActions.ts b/src/composables/auth/useFirebaseAuthActions.ts index 949635821..ca5318ccc 100644 --- a/src/composables/auth/useFirebaseAuthActions.ts +++ b/src/composables/auth/useFirebaseAuthActions.ts @@ -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)