2024-12-02 17:20:27 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { Client } from "@versia/client";
|
2025-02-09 20:14:27 +01:00
|
|
|
import { AlertCircle, Loader } from "lucide-vue-next";
|
2024-12-02 17:20:27 +01:00
|
|
|
import UserAuthForm from "~/components/oauth/login.vue";
|
2024-12-03 12:30:10 +01:00
|
|
|
import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert";
|
2024-12-02 17:20:27 +01:00
|
|
|
import { Button } from "~/components/ui/button";
|
2024-12-07 22:17:22 +01:00
|
|
|
import * as m from "~/paraglide/messages.js";
|
2024-12-02 17:20:27 +01:00
|
|
|
import { NuxtLink } from "#components";
|
2024-04-15 03:16:57 +02:00
|
|
|
|
2024-12-07 11:21:13 +01:00
|
|
|
useHead({
|
2024-12-07 22:17:22 +01:00
|
|
|
title: m.fuzzy_sea_moth_absorb(),
|
2024-12-07 11:21:13 +01:00
|
|
|
});
|
|
|
|
|
|
2025-02-09 20:14:27 +01:00
|
|
|
const baseUrl = useRequestURL();
|
|
|
|
|
const client = computed(() => new Client(new URL(baseUrl)));
|
2025-01-29 04:39:33 +01:00
|
|
|
const instance = useInstanceFromClient(client);
|
2024-12-08 18:15:30 +01:00
|
|
|
const {
|
|
|
|
|
error,
|
|
|
|
|
error_description,
|
|
|
|
|
redirect_uri,
|
|
|
|
|
response_type,
|
|
|
|
|
client_id,
|
|
|
|
|
scope,
|
|
|
|
|
} = useUrlSearchParams();
|
|
|
|
|
const hasValidUrlSearchParams =
|
|
|
|
|
redirect_uri && response_type && client_id && scope;
|
2024-12-02 17:20:27 +01:00
|
|
|
</script>
|
2024-06-16 05:14:13 +02:00
|
|
|
|
2024-12-02 17:20:27 +01:00
|
|
|
<template>
|
2024-12-02 23:32:13 +01:00
|
|
|
<div class="container relative flex h-svh flex-col items-center justify-center md:flex-row lg:max-w-none lg:px-0">
|
2024-12-02 17:20:27 +01:00
|
|
|
<Button :as="NuxtLink" href="/register" variant="link" class="absolute right-4 top-4 md:right-8 md:top-8">
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.noble_cute_ocelot_aim() }}
|
2024-12-02 17:20:27 +01:00
|
|
|
</Button>
|
2024-12-02 23:32:13 +01:00
|
|
|
<div class="relative hidden h-full flex-col bg-muted p-10 text-white dark:border-r lg:flex grow bg-center bg-no-repeat bg-cover"
|
|
|
|
|
:style="{
|
|
|
|
|
backgroundImage: 'url(/images/banner.webp)'
|
|
|
|
|
}">
|
|
|
|
|
<div class="absolute top-0 left-0 w-full h-72 bg-gradient-to-t from-transparent to-black/70" />
|
2024-12-02 17:20:27 +01:00
|
|
|
<div class="relative z-20 flex items-center text-lg font-medium">
|
2024-12-02 23:32:13 +01:00
|
|
|
<img crossorigin="anonymous"
|
|
|
|
|
:src="instance?.thumbnail.url || 'https://cdn.versia.pub/branding/icon.svg'" alt="Versia logo"
|
2024-12-02 17:20:27 +01:00
|
|
|
class="size-10 mr-4" />
|
|
|
|
|
{{ instance?.title }}
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="relative z-20 mt-auto">
|
|
|
|
|
<blockquote class="space-y-2">
|
|
|
|
|
<p class="text-lg">
|
|
|
|
|
“This library has saved me countless hours of work and
|
|
|
|
|
helped me deliver stunning designs to my clients faster than
|
|
|
|
|
ever before.”
|
|
|
|
|
</p>
|
|
|
|
|
<footer class="text-sm">
|
|
|
|
|
Sofia Davis
|
|
|
|
|
</footer>
|
|
|
|
|
</blockquote>
|
|
|
|
|
</div> -->
|
2024-06-15 23:18:58 +02:00
|
|
|
</div>
|
2024-12-02 17:20:27 +01:00
|
|
|
<div class="lg:p-8 w-full max-w-xl">
|
|
|
|
|
<div class="mx-auto flex w-full flex-col justify-center space-y-10 sm:w-[350px]">
|
2024-12-03 12:30:10 +01:00
|
|
|
<Alert v-if="error" variant="destructive" class="mb-4">
|
2024-12-07 13:46:19 +01:00
|
|
|
<AlertCircle class="size-4" />
|
|
|
|
|
<AlertTitle>{{ error }}</AlertTitle>
|
|
|
|
|
<AlertDescription>
|
|
|
|
|
{{ error_description }}
|
|
|
|
|
</AlertDescription>
|
|
|
|
|
</Alert>
|
2024-12-02 17:20:27 +01:00
|
|
|
<div class="flex flex-col space-y-2 text-center">
|
|
|
|
|
<h1 class="text-2xl font-semibold tracking-tight">
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.novel_fine_stork_snap() }}
|
2024-12-02 17:20:27 +01:00
|
|
|
</h1>
|
2024-12-07 22:17:22 +01:00
|
|
|
<p class="text-sm text-muted-foreground" v-html="m.smug_main_whale_snip({
|
2025-02-09 20:14:27 +01:00
|
|
|
host: baseUrl.host,
|
2024-12-07 22:17:22 +01:00
|
|
|
})">
|
2024-12-02 17:20:27 +01:00
|
|
|
</p>
|
|
|
|
|
</div>
|
2025-01-29 04:39:33 +01:00
|
|
|
<template v-if="instance && hasValidUrlSearchParams">
|
|
|
|
|
<UserAuthForm :instance="instance" />
|
|
|
|
|
</template>
|
2024-12-08 18:15:30 +01:00
|
|
|
<div v-else-if="hasValidUrlSearchParams" class="p-4 flex items-center justify-center h-48">
|
2024-12-02 17:20:27 +01:00
|
|
|
<Loader class="size-8 animate-spin" />
|
|
|
|
|
</div>
|
2024-12-08 18:15:30 +01:00
|
|
|
<Alert v-else variant="destructive" class="mb-4">
|
|
|
|
|
<AlertCircle class="size-4" />
|
|
|
|
|
<AlertTitle>{{ m.grand_spry_goldfish_embrace() }}</AlertTitle>
|
|
|
|
|
<AlertDescription>
|
|
|
|
|
<p>{{ m.gray_clean_shark_comfort() }}</p>
|
|
|
|
|
<ul class="list-disc list-inside mt-2 font-mono">
|
|
|
|
|
<li>redirect_uri</li>
|
|
|
|
|
<li>response_type</li>
|
|
|
|
|
<li>client_id</li>
|
|
|
|
|
<li>scope</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</AlertDescription>
|
|
|
|
|
</Alert>
|
2024-12-02 17:20:27 +01:00
|
|
|
</div>
|
2024-06-15 23:18:58 +02:00
|
|
|
</div>
|
2024-04-29 01:48:03 +02:00
|
|
|
</div>
|
2024-04-15 03:16:57 +02:00
|
|
|
</template>
|