From dbbf8a44878bb997e006613d0ce55eb11721205c Mon Sep 17 00:00:00 2001 From: Kevin Adametz Date: Thu, 2 Jul 2026 09:04:26 +0000 Subject: [PATCH] 5.5: + 6 Auth-Passwortfelder umgestellt Self-contained Alpine-Toggle (Anzeigen/Verbergen) pro Feld; Props name/label/ autocomplete/placeholder/required/autofocus/show-error, id default auth-, Slot :labelAction fuer den 'Passwort vergessen?'-Link (login). Ersetzt die field-pw-wrap-Bloecke in login, register (2), reset-password (2), confirm- password (1). Die nun ungenutzten form-level x-data={showPassword...} entfernt. Nebeneffekt/Bugfix: register+reset nutzten :placeholder="__(...)" auf rohem -> wurde als Alpine-Bind woertlich ausgegeben und schlug fehl (leerer Platzhalter). Als Component-Prop wird __() korrekt in PHP aufgeloest, der Hinweistext (z. B. 'Mindestens 8 Zeichen') erscheint jetzt. Bestaetigungsfelder ohne Fehleranzeige (show-error=false, wie zuvor). 116 Auth-Tests gruen, alle Views kompilieren. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../views/components/password-input.blade.php | 72 +++++++++++++++++++ .../livewire/auth/confirm-password.blade.php | 33 ++------- resources/views/livewire/auth/login.blade.php | 32 ++------- .../views/livewire/auth/register.blade.php | 59 ++++----------- .../livewire/auth/reset-password.blade.php | 59 ++++----------- 5 files changed, 112 insertions(+), 143 deletions(-) create mode 100644 resources/views/components/password-input.blade.php diff --git a/resources/views/components/password-input.blade.php b/resources/views/components/password-input.blade.php new file mode 100644 index 00000000..83a04aba --- /dev/null +++ b/resources/views/components/password-input.blade.php @@ -0,0 +1,72 @@ +@props([ + /** Feldname: wire:model-Ziel + @error-Key (z. B. 'password', 'password_confirmation') */ + 'name', + + /** Label-Text (bereits übersetzt) */ + 'label', + + /** DOM-id; Standard: auth- */ + 'id' => null, + + /** autocomplete-Hinweis (current-password | new-password) */ + 'autocomplete' => 'current-password', + + /** Platzhalter im Feld */ + 'placeholder' => '••••••••••', + + /** Pflichtfeld */ + 'required' => true, + + /** Autofokus setzen (z. B. Passwort-Bestätigungsseite) */ + 'autofocus' => false, + + /** aria-invalid + Fehlermeldung anzeigen (bei Bestätigungsfeldern aus) */ + 'showError' => true, +]) + +@php + $id ??= 'auth-'.str_replace('_', '-', $name); +@endphp + +{{-- + Passwort-Feld mit Anzeigen/Verbergen-Umschalter (self-contained Alpine). + Optionaler Slot :labelAction für Zusatzlink in der Label-Zeile (z. B. + „Passwort vergessen?"). Ersetzt die kopierten field-pw-wrap-Blöcke der + Auth-Seiten. +--}} +
+ @isset($labelAction) +
+ + {{ $labelAction }} +
+ @else + + @endisset + +
+ + +
+ + @if ($showError) + @error($name) +

{{ $message }}

+ @enderror + @endif +
diff --git a/resources/views/livewire/auth/confirm-password.blade.php b/resources/views/livewire/auth/confirm-password.blade.php index a8d6a6b8..edd0e89c 100644 --- a/resources/views/livewire/auth/confirm-password.blade.php +++ b/resources/views/livewire/auth/confirm-password.blade.php @@ -37,33 +37,14 @@ new #[Layout('components.layouts.auth.pressekonto', ['heading' => 'Passwort best {{ __('Dieser Bereich des Publisher-Hubs ist besonders geschützt. Bitte bestätigen Sie zur Sicherheit erneut Ihr Passwort, bevor Sie fortfahren.') }}

-
+ -
- -
- - -
- @error('password') -

{{ $message }}

- @enderror -
+ - - @error('password') -

{{ $message }}

- @enderror - + +