Loheide-eu-mitarbeiterplatt.../resources/js/pages/Auth/Login.vue
Friederich Loheide 4fcc41ed30
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m41s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m48s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m15s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m17s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m48s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m26s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m59s
Phase 6 (Teil 2): OpenID Connect, LDAP/AD und SAML 2
- Gemeinsamer Treiber-Unterbau (App\Identity\IdentityDriver, IdentityDrivers,
  IdentityLogin, AttributeProfile); Entra ID nutzt ihn ebenfalls
- Plugins oidc, ldap und saml mit Profil- und Gruppen-Zuordnung
- Admin: Verfahren wählen, Formular je Verfahren, zuletzt empfangene Angaben
- onelogin/php-saml als neue Abhängigkeit

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

116 lines
5.2 KiB
Vue

<script setup>
import { ref } from 'vue';
import { Link, useForm } from '@inertiajs/vue3';
import { Building2, Eye, EyeOff, KeyRound, LoaderCircle, ShieldCheck } 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>
<Building2 v-else-if="provider.type === 'ldap'" class="size-[18px] text-muted-foreground" aria-hidden="true" />
<ShieldCheck v-else-if="provider.type === 'saml'" class="size-[18px] text-muted-foreground" aria-hidden="true" />
<KeyRound v-else class="size-[18px] text-muted-foreground" aria-hidden="true" />
{{ 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>