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
+6 -2
View File
@@ -23,14 +23,17 @@ import BaseInput from '~/components/BaseInput.vue'
import { toast } from '~/main'
const config = useRuntimeConfig()
const API_BASE_URL = config.public.apiBaseUrl
const route = useRoute()
const reason = ref('')
const error = ref('')
const isWaitingForRegister = ref(false)
const token = ref('')
const inviteToken = ref('')
onMounted(async () => {
token.value = route.query.token || ''
inviteToken.value = route.query.invite_token || ''
if (!token.value) {
await navigateTo({ path: '/signup' }, { replace: true })
}
@@ -50,8 +53,9 @@ const submit = async () => {
'Content-Type': 'application/json',
},
body: JSON.stringify({
token: this.token,
reason: this.reason,
token: token.value,
reason: reason.value,
...(inviteToken.value ? { inviteToken: inviteToken.value } : {}),
}),
})
isWaitingForRegister.value = false