feat: pass invite token through signup flow

This commit is contained in:
Tim
2025-08-17 12:11:13 +08:00
parent 2dd56e27af
commit e0df78deee
18 changed files with 63 additions and 29 deletions

View File

@@ -9,14 +9,17 @@ import { googleAuthWithToken } from '~/utils/google'
onMounted(async () => {
const hash = new URLSearchParams(window.location.hash.substring(1))
const idToken = hash.get('id_token')
const inviteToken = hash.get('state')
if (idToken) {
await googleAuthWithToken(
idToken,
inviteToken,
() => {
navigateTo('/', { replace: true })
},
(token) => {
navigateTo(`/signup-reason?token=${token}`, { replace: true })
const q = inviteToken ? `&invite_token=${inviteToken}` : ''
navigateTo(`/signup-reason?token=${token}${q}`, { replace: true })
},
)
} else {