mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 00:18:20 +01:00
44 lines
1.1 KiB
Vue
44 lines
1.1 KiB
Vue
<template>
|
|
<Card v-if="code && domain" class="w-full max-w-md *:w-full">
|
|
<CardHeader>
|
|
<CardTitle>Signing in...</CardTitle>
|
|
<CardDescription>
|
|
You will be redirected shortly.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
</Card>
|
|
<Card v-else class="w-full max-w-md *:w-full">
|
|
<CardHeader>
|
|
<CardTitle>Error</CardTitle>
|
|
<CardDescription>
|
|
Missing code or domain in the callback URL.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
</Card>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import {
|
|
Card,
|
|
CardDescription,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from "~/components/ui/card";
|
|
|
|
// This page handles the OAuth callback and signs the user in
|
|
definePageMeta({
|
|
layout: "auth",
|
|
});
|
|
|
|
const code = useRequestURL().searchParams.get("code");
|
|
const domain = useRequestURL().searchParams.get("domain");
|
|
const authStore = useAuthStore();
|
|
|
|
if (code && domain) {
|
|
const newOrigin = new URL(`https://${domain}`);
|
|
|
|
await authStore.finishSignIn(code, newOrigin);
|
|
await navigateTo("/");
|
|
}
|
|
</script>
|