2024-05-17 09:50:16 +02:00
|
|
|
<template>
|
2024-12-03 12:30:10 +01:00
|
|
|
<div class="flex h-svh items-center justify-center px-6 py-12 lg:px-8 bg-center bg-no-repeat bg-cover" :style="{
|
|
|
|
|
backgroundImage: 'url(/images/banner.webp)'
|
|
|
|
|
}">
|
|
|
|
|
<Card v-if="params.success" class="w-full max-w-md">
|
|
|
|
|
<CardHeader>
|
2024-12-07 22:17:22 +01:00
|
|
|
<CardTitle>{{ m.late_mean_capybara_fade() }}</CardTitle>
|
2024-12-03 12:30:10 +01:00
|
|
|
<CardDescription>
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.brave_acidic_lobster_fetch() }}
|
2024-12-03 12:30:10 +01:00
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardFooter class="grid">
|
|
|
|
|
<Button :as="NuxtLink" href="/" variant="default">
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.every_tangy_koala_persist() }}
|
2024-12-03 12:30:10 +01:00
|
|
|
</Button>
|
|
|
|
|
</CardFooter>
|
|
|
|
|
</Card>
|
|
|
|
|
<Card v-else class="w-full max-w-md">
|
|
|
|
|
<form method="POST" action="/api/auth/reset" @submit="form.submitForm">
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<Alert v-if="params.login_reset" variant="default" class="mb-4">
|
2024-12-07 13:46:19 +01:00
|
|
|
<AlertCircle class="size-4" />
|
2024-12-07 22:17:22 +01:00
|
|
|
<AlertTitle>{{ m.east_loud_lobster_explore() }}</AlertTitle>
|
2024-12-03 12:30:10 +01:00
|
|
|
<AlertDescription>
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.good_plane_gazelle_glow() }}
|
2024-12-03 12:30:10 +01:00
|
|
|
</AlertDescription>
|
|
|
|
|
</Alert>
|
|
|
|
|
<Alert v-if="params.error" variant="destructive" class="mb-4">
|
2024-12-07 13:46:19 +01:00
|
|
|
<AlertCircle class="size-4" />
|
2024-12-03 12:30:10 +01:00
|
|
|
<AlertTitle>{{ params.error }}</AlertTitle>
|
|
|
|
|
<AlertDescription>
|
|
|
|
|
{{ params.error_description }}
|
|
|
|
|
</AlertDescription>
|
|
|
|
|
</Alert>
|
2024-12-07 22:17:22 +01:00
|
|
|
<CardTitle as="h1">{{ m.tired_green_sloth_evoke() }}</CardTitle>
|
2024-12-03 12:30:10 +01:00
|
|
|
<CardDescription>
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.solid_slow_platypus_talk() }}
|
2024-12-03 12:30:10 +01:00
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent class="grid gap-6">
|
|
|
|
|
<FormField v-slot="{ componentField }" name="token">
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormControl>
|
|
|
|
|
<input type="hidden" v-bind="componentField" />
|
|
|
|
|
</FormControl>
|
|
|
|
|
</FormItem>
|
|
|
|
|
</FormField>
|
|
|
|
|
<FormField v-slot="{ componentField }" name="password">
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormLabel>
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.true_male_gadfly_stab() }}
|
2024-12-03 12:30:10 +01:00
|
|
|
</FormLabel>
|
|
|
|
|
<FormControl>
|
|
|
|
|
<Input placeholder="hunter2" type="password" auto-capitalize="none" auto-correct="off"
|
|
|
|
|
v-bind="componentField" />
|
|
|
|
|
</FormControl>
|
|
|
|
|
<FormMessage />
|
|
|
|
|
</FormItem>
|
|
|
|
|
</FormField>
|
|
|
|
|
<FormField v-slot="{ componentField }" name="password-confirm">
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormLabel>
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.awful_cozy_jannes_rise() }}
|
2024-12-03 12:30:10 +01:00
|
|
|
</FormLabel>
|
|
|
|
|
<FormControl>
|
|
|
|
|
<Input placeholder="hunter2" type="password" auto-capitalize="none" auto-correct="off"
|
|
|
|
|
v-bind="componentField" />
|
|
|
|
|
</FormControl>
|
|
|
|
|
<FormMessage />
|
|
|
|
|
</FormItem>
|
|
|
|
|
</FormField>
|
|
|
|
|
</CardContent>
|
|
|
|
|
<CardFooter class="grid gap-2">
|
2024-12-07 22:17:22 +01:00
|
|
|
<Button variant="default" type="submit">{{ m.noisy_round_skate_yell() }}</Button>
|
2024-12-03 12:30:10 +01:00
|
|
|
</CardFooter>
|
|
|
|
|
</form>
|
|
|
|
|
</Card>
|
2024-05-17 09:50:16 +02:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { toTypedSchema } from "@vee-validate/zod";
|
2024-12-03 12:30:10 +01:00
|
|
|
import { AlertCircle } from "lucide-vue-next";
|
|
|
|
|
import { useForm } from "vee-validate";
|
2024-05-17 09:50:16 +02:00
|
|
|
import { z } from "zod";
|
2024-12-03 12:30:10 +01:00
|
|
|
import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert";
|
|
|
|
|
import { Button } from "~/components/ui/button";
|
|
|
|
|
import {
|
|
|
|
|
Card,
|
|
|
|
|
CardContent,
|
|
|
|
|
CardFooter,
|
|
|
|
|
CardHeader,
|
|
|
|
|
CardTitle,
|
|
|
|
|
} from "~/components/ui/card";
|
|
|
|
|
import {
|
|
|
|
|
FormControl,
|
|
|
|
|
FormField,
|
|
|
|
|
FormItem,
|
|
|
|
|
FormLabel,
|
|
|
|
|
FormMessage,
|
|
|
|
|
} from "~/components/ui/form";
|
|
|
|
|
import { Input } from "~/components/ui/input";
|
2024-12-07 22:17:22 +01:00
|
|
|
import * as m from "~/paraglide/messages.js";
|
2024-12-03 12:30:10 +01:00
|
|
|
import { NuxtLink } from "#components";
|
2024-05-17 09:50:16 +02:00
|
|
|
|
2024-12-07 11:21:13 +01:00
|
|
|
useHead({
|
2024-12-07 22:17:22 +01:00
|
|
|
title: m.arable_arable_herring_lead(),
|
2024-12-07 11:21:13 +01:00
|
|
|
});
|
|
|
|
|
|
2024-06-10 05:24:55 +02:00
|
|
|
identity.value = null;
|
2024-05-17 10:28:14 +02:00
|
|
|
|
2024-12-03 12:30:10 +01:00
|
|
|
const formSchema = toTypedSchema(
|
2024-05-17 10:28:14 +02:00
|
|
|
z
|
|
|
|
|
.object({
|
2024-12-03 12:30:10 +01:00
|
|
|
token: z.string(),
|
|
|
|
|
password: z
|
|
|
|
|
.string()
|
|
|
|
|
.min(3, {
|
2024-12-07 22:17:22 +01:00
|
|
|
message: m.smart_bold_macaw_aid({
|
|
|
|
|
count: 3,
|
|
|
|
|
}),
|
2024-12-03 12:30:10 +01:00
|
|
|
})
|
|
|
|
|
.max(100, {
|
2024-12-07 22:17:22 +01:00
|
|
|
message: m.dry_smug_goldfish_promise({
|
|
|
|
|
count: 100,
|
|
|
|
|
}),
|
2024-12-03 12:30:10 +01:00
|
|
|
}),
|
|
|
|
|
"password-confirm": z
|
|
|
|
|
.string()
|
|
|
|
|
.min(3, {
|
2024-12-07 22:17:22 +01:00
|
|
|
message: m.smart_bold_macaw_aid({
|
|
|
|
|
count: 3,
|
|
|
|
|
}),
|
2024-12-03 12:30:10 +01:00
|
|
|
})
|
|
|
|
|
.max(100, {
|
2024-12-07 22:17:22 +01:00
|
|
|
message: m.dry_smug_goldfish_promise({
|
|
|
|
|
count: 100,
|
|
|
|
|
}),
|
2024-12-03 12:30:10 +01:00
|
|
|
}),
|
2024-05-17 10:28:14 +02:00
|
|
|
})
|
2024-05-17 09:50:16 +02:00
|
|
|
.superRefine((data, ctx) => {
|
2024-06-16 08:44:16 +02:00
|
|
|
if (data.password !== data["password-confirm"]) {
|
2024-05-17 09:50:16 +02:00
|
|
|
ctx.addIssue({
|
2024-06-16 08:44:16 +02:00
|
|
|
path: [...ctx.path, "password-confirm"],
|
2024-05-17 09:50:16 +02:00
|
|
|
code: "custom",
|
2024-12-07 22:17:22 +01:00
|
|
|
message: m.candid_fancy_leopard_prosper(),
|
2024-05-17 09:50:16 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return {};
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
|
2024-06-20 03:40:13 +02:00
|
|
|
const params = useUrlSearchParams();
|
2024-05-17 09:50:16 +02:00
|
|
|
|
2024-12-03 12:30:10 +01:00
|
|
|
const form = useForm({
|
|
|
|
|
validationSchema: formSchema,
|
|
|
|
|
initialValues: {
|
|
|
|
|
token: (params.token as string) ?? undefined,
|
|
|
|
|
},
|
|
|
|
|
});
|
2024-05-17 09:50:16 +02:00
|
|
|
</script>
|