mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-09 19:47:39 +08:00
feat: pass invite token through signup flow
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user