Self-contained Alpine-Toggle (Anzeigen/Verbergen) pro Feld; Props name/label/
autocomplete/placeholder/required/autofocus/show-error, id default auth-<name>,
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
<input> -> 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) <noreply@anthropic.com>
54 lines
1.8 KiB
PHP
54 lines
1.8 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Validation\ValidationException;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Volt\Component;
|
|
|
|
new #[Layout('components.layouts.auth.pressekonto', ['heading' => 'Passwort bestätigen', 'eyebrow' => 'Sicherheitsbereich', 'showFromBanner' => false])] class extends Component {
|
|
public string $password = '';
|
|
|
|
/**
|
|
* Confirm the current user's password.
|
|
*/
|
|
public function confirmPassword(): void
|
|
{
|
|
$this->validate([
|
|
'password' => ['required', 'string'],
|
|
]);
|
|
|
|
if (! Auth::guard('web')->validate([
|
|
'email' => Auth::user()->email,
|
|
'password' => $this->password,
|
|
])) {
|
|
throw ValidationException::withMessages([
|
|
'password' => __('auth.password'),
|
|
]);
|
|
}
|
|
|
|
session(['auth.password_confirmed_at' => time()]);
|
|
|
|
$this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
|
|
}
|
|
}; ?>
|
|
|
|
<div>
|
|
<p class="text-[13.5px] text-ink-2 leading-[1.65] !-mt-4 mb-6">
|
|
{{ __('Dieser Bereich des Publisher-Hubs ist besonders geschützt. Bitte bestätigen Sie zur Sicherheit erneut Ihr Passwort, bevor Sie fortfahren.') }}
|
|
</p>
|
|
|
|
<form wire:submit="confirmPassword" class="space-y-[18px]" novalidate>
|
|
|
|
<x-password-input
|
|
name="password"
|
|
:label="__('Passwort')"
|
|
autocomplete="current-password"
|
|
:autofocus="true"
|
|
/>
|
|
|
|
<button type="submit" class="auth-btn-primary !mt-[22px]" wire:loading.attr="disabled" wire:target="confirmPassword">
|
|
<span wire:loading.remove wire:target="confirmPassword">{{ __('Bestätigen') }}</span>
|
|
<span wire:loading wire:target="confirmPassword">{{ __('Wird geprüft …') }}</span>
|
|
</button>
|
|
</form>
|
|
</div>
|