Initial commit of testapi
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
<script setup lang="ts">
|
||||
import InputError from '@/components/InputError.vue';
|
||||
import TextLink from '@/components/TextLink.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import AuthBase from '@/layouts/AuthLayout.vue';
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import { LoaderCircle } from 'lucide-vue-next';
|
||||
|
||||
defineProps<{
|
||||
status?: string;
|
||||
canResetPassword: boolean;
|
||||
}>();
|
||||
|
||||
const form = useForm({
|
||||
email: '',
|
||||
password: '',
|
||||
remember: false,
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
form.post(route('login'), {
|
||||
onFinish: () => form.reset('password'),
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AuthBase title="Logg inn på kontoen din" description="Oppgi din epostadresse og passord for å logge inn">
|
||||
<Head title="Log in" />
|
||||
|
||||
<div v-if="status" class="mb-4 text-center text-sm font-medium text-green-600">
|
||||
{{ status }}
|
||||
</div>
|
||||
|
||||
<form @submit.prevent="submit" class="flex flex-col gap-6">
|
||||
<div class="grid gap-6">
|
||||
<div class="grid gap-2">
|
||||
<Label for="email">Epost adresse</Label>
|
||||
<Input
|
||||
id="email"
|
||||
type="email"
|
||||
required
|
||||
autofocus
|
||||
:tabindex="1"
|
||||
autocomplete="email"
|
||||
v-model="form.email"
|
||||
placeholder="ola@nordmann.no"
|
||||
/>
|
||||
<InputError :message="form.errors.email" />
|
||||
</div>
|
||||
|
||||
<div class="grid gap-2">
|
||||
<div class="flex items-center justify-between">
|
||||
<Label for="password">Passord</Label>
|
||||
<TextLink v-if="canResetPassword" :href="route('password.request')" class="text-sm" :tabindex="5">
|
||||
Glemt passord?
|
||||
</TextLink>
|
||||
</div>
|
||||
<Input
|
||||
id="password"
|
||||
type="password"
|
||||
required
|
||||
:tabindex="2"
|
||||
autocomplete="current-password"
|
||||
v-model="form.password"
|
||||
placeholder="Passord"
|
||||
/>
|
||||
<InputError :message="form.errors.password" />
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<Label for="remember" class="flex items-center space-x-3">
|
||||
<Checkbox id="remember" v-model="form.remember" :tabindex="3" />
|
||||
<span>Husk meg</span>
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
<Button type="submit" class="mt-4 w-full" :tabindex="4" :disabled="form.processing">
|
||||
<LoaderCircle v-if="form.processing" class="h-4 w-4 animate-spin" />
|
||||
Logg inn
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div class="text-center text-sm text-muted-foreground">
|
||||
Bruker registrering er avslått for denne nettsiden
|
||||
</div>
|
||||
</form>
|
||||
</AuthBase>
|
||||
</template>
|
||||
Reference in New Issue
Block a user