frontend/app/pages/callback/[domain].vue
Jesse Wierzbinski d01aa22477
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 0s
Deploy to GitHub Pages / build (push) Failing after 0s
Deploy to GitHub Pages / deploy (push) Has been skipped
Docker / build (push) Failing after 0s
Mirror to Codeberg / Mirror (push) Failing after 0s
fix: 🐛 Fix broken auth consent flow
2025-12-11 04:10:45 +01:00

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 = useRoute().params.domain as string;
const authStore = useAuthStore();
if (code && domain) {
const newOrigin = new URL(`https://${domain}`);
await authStore.finishSignIn(code, newOrigin);
await navigateTo("/", {
external: true,
});
}
</script>