Skip to content

Commit 529a4de

Browse files
committed
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.
1 parent 5c0eef8 commit 529a4de

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/composables/auth/useFirebaseAuthActions.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FirebaseError } from 'firebase/app'
22
import { ref } from 'vue'
3-
import { useRouter } from 'vue-router'
3+
import { useRoute, useRouter } from 'vue-router'
44

55
import { useErrorHandling } from '@/composables/useErrorHandling'
66
import { t } from '@/i18n'
@@ -16,6 +16,7 @@ import { usdToMicros } from '@/utils/formatUtil'
1616
export const useFirebaseAuthActions = () => {
1717
const authStore = useFirebaseAuthStore()
1818
const toastStore = useToastStore()
19+
const route = useRoute()
1920
const router = useRouter()
2021
const { wrapWithErrorHandlingAsync, toastErrorHandler } = useErrorHandling()
2122

@@ -57,7 +58,12 @@ export const useFirebaseAuthActions = () => {
5758
// Redirect to login page if we're on cloud domain
5859
const hostname = window.location.hostname
5960
if (hostname.includes('cloud.comfy.org')) {
60-
await router.push({ name: 'cloud-login' })
61+
if (route.query.inviteCode) {
62+
const inviteCode = route.query.inviteCode
63+
await router.push({ name: 'cloud-login', query: { inviteCode } })
64+
} else {
65+
await router.push({ name: 'cloud-login' })
66+
}
6167
}
6268
}, reportError)
6369

0 commit comments

Comments
 (0)