Loheide-eu-mitarbeiterplatt.../resources/js/pages/Auth/Login.vue
Friederich Loheide 82bbeef31b
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m7s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m11s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m16s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m18s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m46s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m41s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m0s
Phase 5: Erscheinungsbild mit Entwurf, Vorschau und Veröffentlichen
- Theme in den Einstellungen (Entwurf/veröffentlicht), Übernahme der
  Einstellungen aus Phase 0; statische CSS-Datei mit Hash beim Veröffentlichen
- Logos hell/dunkel, Signet, App-Symbol → Favicon, Homescreen-Symbole,
  Web-App-Manifest; SVG-Bereinigung
- Markenfarbe exakt, zweite Akzentfarbe, Kopfleiste hell/Marke/dunkel,
  Kontrastprüfung (WCAG AA) mit automatisch lesbarer Linkfarbe
- Lokale Schriften (Latein), Überschriften-Schrift, eigene WOFF2-Schrift,
  Ecken, Dichte, Dunkelmodus-Regel
- Anmeldeseite (geteilt/zentriert, Bild, Texte), Fußzeile, E-Mails im Design
- Admin: Live-Vorschau (Startseite, Anmeldung, Beispielseite; hell/dunkel),
  Veröffentlichen, Verwerfen, Export/Import, Zurücksetzen, eigenes CSS
- Admin-Bereich übernimmt Logo, Farbe und Favicon; Whitelabel

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:46:05 +00:00

113 lines
4.8 KiB
Vue

<script setup>
import { ref } from 'vue';
import { Link, useForm } from '@inertiajs/vue3';
import { Eye, EyeOff, LoaderCircle } from '@lucide/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 FormField from '@/components/FormField.vue';
import GuestLayout from '@/layouts/GuestLayout.vue';
const props = defineProps({
canResetPassword: { type: Boolean, default: false },
status: { type: String, default: null },
providers: { type: Array, default: () => [] },
identityError: { type: String, default: null },
// Vorschau im Admin („Erscheinungsbild“): nur ansehen, nicht anmelden.
preview: { type: Boolean, default: false },
});
const showPassword = ref(false);
const form = useForm({
email: '',
password: '',
remember: false,
});
function submit() {
if (props.preview) return;
form.post('/login', {
onFinish: () => form.reset('password'),
});
}
</script>
<template>
<GuestLayout title="Anmelden" description="Melden Sie sich mit Ihrer dienstlichen E-Mail-Adresse an.">
<div v-if="status" class="mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground">
{{ status }}
</div>
<div v-if="identityError" class="mb-6 rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive" role="alert">
{{ identityError }}
</div>
<div v-if="providers.length" class="mb-6 grid gap-3">
<a
v-for="provider in providers"
:key="provider.slug"
:href="`/auth/${provider.slug}/redirect`"
class="inline-flex h-11 items-center justify-center gap-3 rounded-md border border-input bg-card px-4 text-sm font-medium shadow-xs transition-colors hover:bg-accent"
>
<svg v-if="provider.type === 'entra'" class="size-[18px]" viewBox="0 0 21 21" aria-hidden="true">
<rect x="1" y="1" width="9" height="9" fill="#f25022" />
<rect x="11" y="1" width="9" height="9" fill="#7fba00" />
<rect x="1" y="11" width="9" height="9" fill="#00a4ef" />
<rect x="11" y="11" width="9" height="9" fill="#ffb900" />
</svg>
{{ provider.label }}
</a>
<div class="my-2 flex items-center gap-3 text-xs text-muted-foreground">
<span class="h-px flex-1 bg-border" />
oder mit E-Mail und Passwort
<span class="h-px flex-1 bg-border" />
</div>
</div>
<form class="grid gap-5" @submit.prevent="submit">
<FormField id="email" label="E-Mail-Adresse" :error="form.errors.email">
<Input id="email" v-model="form.email" type="email" autocomplete="username" autofocus class="h-10" :aria-invalid="!!form.errors.email" />
</FormField>
<FormField id="password" label="Passwort" :error="form.errors.password">
<div class="relative">
<Input
id="password"
v-model="form.password"
:type="showPassword ? 'text' : 'password'"
autocomplete="current-password"
class="h-10 pr-10"
:aria-invalid="!!form.errors.password"
/>
<button
type="button"
class="absolute inset-y-0 right-0 grid w-10 place-items-center text-muted-foreground hover:text-foreground"
:aria-label="showPassword ? 'Passwort verbergen' : 'Passwort anzeigen'"
@click="showPassword = !showPassword"
>
<EyeOff v-if="showPassword" class="size-4" />
<Eye v-else class="size-4" />
</button>
</div>
</FormField>
<div class="flex items-center justify-between">
<Label class="flex items-center gap-2 text-sm font-normal">
<Checkbox v-model="form.remember" />
Angemeldet bleiben
</Label>
<Link v-if="canResetPassword" href="/forgot-password" class="text-sm font-medium text-brand-text hover:underline">
Passwort vergessen?
</Link>
</div>
<Button type="submit" size="lg" class="mt-2 h-10 w-full" :disabled="form.processing">
<LoaderCircle v-if="form.processing" class="animate-spin" />
Anmelden
</Button>
</form>
</GuestLayout>
</template>