mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 22:21:09 +08:00
27 lines
608 B
Vue
27 lines
608 B
Vue
<template>
|
|
<CallbackPage />
|
|
</template>
|
|
|
|
<script setup>
|
|
import CallbackPage from '~/components/CallbackPage.vue'
|
|
import { googleAuthWithToken } from '~/utils/google'
|
|
|
|
onMounted(async () => {
|
|
const hash = new URLSearchParams(window.location.hash.substring(1))
|
|
const idToken = hash.get('id_token')
|
|
if (idToken) {
|
|
await googleAuthWithToken(
|
|
idToken,
|
|
() => {
|
|
navigateTo('/', { replace: true })
|
|
},
|
|
(token) => {
|
|
navigateTo(`/signup-reason?token=${token}`, { replace: true })
|
|
},
|
|
)
|
|
} else {
|
|
navigateTo('/login', { replace: true })
|
|
}
|
|
})
|
|
</script>
|