Files
neonail-database/resources/views/auth/login.blade.php
T
HousemannandClaude Sonnet 4.6 60259a3655 Add Authentik SSO via OAuth2/OIDC
Implements Single Sign-On with Authentik alongside the existing
password login. Admins configure Client ID, Client Secret and Base URL
directly in the app; the SSO button on the login page only appears
when the configuration is complete and enabled.

- SsoSetting model + migration (one-row config table)
- sso_provider_id / is_sso_user fields on users (migration)
- SsoController: redirect to Authentik + callback (token exchange,
  userinfo fetch, auto-create unknown users)
- Admin\SsoSettingController + admin/sso/show view with setup guide
  and one-click Redirect URI copy
- Admin dropdown: SSO-Konfiguration entry
- Login page: Authentik button rendered conditionally

No additional Composer packages required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 15:13:30 +02:00

98 lines
4.5 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@extends('layouts.app')
@section('title', 'Anmelden NeoNail DB')
@section('content')
<div class="d-flex align-items-center justify-content-center" style="min-height: 72vh;">
<div style="width: 100%; max-width: 400px;">
{{-- Logo / Hero --}}
<div class="text-center mb-5">
<div style="width:72px; height:72px; background:rgba(255,255,255,0.13); border-radius:20px;
display:inline-flex; align-items:center; justify-content:center; font-size:2.1rem;
margin-bottom:16px; border:1px solid rgba(255,255,255,0.18);">
💅
</div>
<h1 style="color:#fff; font-weight:800; font-size:1.8rem; letter-spacing:-0.04em; margin-bottom:5px;">
NeoNail DB
</h1>
<p style="color:rgba(255,255,255,0.60); margin:0; font-size:0.92rem;">
Melden Sie sich an, um Ihre Sammlung zu verwalten
</p>
</div>
{{-- Card --}}
<div class="card">
<div class="card-body p-4">
@if($errors->any())
<div class="alert alert-danger mb-4">
<i class="fas fa-exclamation-circle me-2"></i>
{{ $errors->first() }}
</div>
@endif
<form method="POST" action="{{ route('login') }}">
@csrf
<div class="mb-3">
<label for="email" class="form-label">E-Mail-Adresse</label>
<input id="email" type="email"
class="form-control @error('email') is-invalid @enderror"
name="email" value="{{ old('email') }}"
required autocomplete="email" autofocus
placeholder="ihre@email.de">
@error('email')
<div class="invalid-feedback">{{ $message }}</div>
@enderror
</div>
<div class="mb-4">
<label for="password" class="form-label">Passwort</label>
<input id="password" type="password"
class="form-control @error('password') is-invalid @enderror"
name="password" required autocomplete="current-password"
placeholder="••••••••">
@error('password')
<div class="invalid-feedback">{{ $message }}</div>
@enderror
</div>
<div class="mb-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="remember"
id="remember" {{ old('remember') ? 'checked' : '' }}>
<label class="form-check-label" for="remember"
style="font-size:.85rem; color:#6b7280;">
Angemeldet bleiben
</label>
</div>
</div>
<button type="submit" class="btn btn-primary w-100 btn-lg">
<i class="fas fa-sign-in-alt me-2"></i>Anmelden
</button>
</form>
@php $sso = \App\Models\SsoSetting::get(); @endphp
@if($sso->isConfigured())
<div class="d-flex align-items-center my-4" style="gap:12px;">
<hr style="flex:1; border-color:rgba(0,0,0,.12); margin:0;">
<span style="font-size:.78rem; color:#9ca3af; white-space:nowrap;">oder</span>
<hr style="flex:1; border-color:rgba(0,0,0,.12); margin:0;">
</div>
<a href="{{ route('sso.redirect') }}" class="btn btn-outline-secondary w-100 btn-lg d-flex align-items-center justify-content-center gap-2">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20A14.5 14.5 0 0 0 12 2"/><path d="M2 12h20"/>
</svg>
Mit Authentik anmelden
</a>
@endif
</div>
</div>
</div>
</div>
@endsection