isSatisfiedBy($this->user())) { $this->continueToIntended(); } } public function confirmWithCode(): void { $user = $this->user(); abort_unless($user->hasEnabledTwoFactorAuthentication(), 403); $this->assertSecondFactor($user); app(StrongAuthentication::class)->mark($user, 'totp'); app(SecurityConfirmation::class)->markConfirmed($user); $this->continueToIntended(); } /** * Aufruf nach erfolgreicher Passkey-Zeremonie im Browser. */ public function passkeyConfirmed(): void { if (! app(StrongAuthentication::class)->isSatisfiedBy($this->user())) { $this->addError('passkey', __('Der Passkey konnte nicht bestätigt werden. Bitte versuchen Sie es erneut.')); return; } $this->continueToIntended(); } public function with(): array { $user = $this->user(); return [ 'hasPasskeys' => app(StrongAuthentication::class)->hasPasskeys($user), 'hasTotp' => $user->hasEnabledTwoFactorAuthentication(), ]; } private function continueToIntended(): void { $intended = session()->pull(StrongAuthentication::INTENDED_KEY); $host = request()->getHost(); // Nur Ziele auf dieser Domain (kein offener Redirect). $target = is_string($intended) && parse_url($intended, PHP_URL_HOST) === $host ? $intended : route('dashboard'); $this->redirect($target); } private function user(): User { /** @var User */ return auth()->user(); } }; ?>
@if ($hasPasskeys)
{{ __('Mit Passkey') }}

{{ __('Fingerabdruck, Gesicht oder Geräte-PIN — ohne Code aus der App.') }}

{{ __('Mit Passkey bestätigen') }}

@error('passkey')

{{ $message }}

@enderror
@endif @if ($hasTotp)
{{ __('Mit Authenticator-App') }}
{{ __('Bestätigen') }}
@endif @if (! $hasPasskeys && ! $hasTotp)
{{ __('Zweiten Faktor einrichten') }}

{{ __('Für Administratoren ist ein zweiter Faktor Pflicht. Richten Sie am einfachsten einen Passkey ein — alternativ die Authenticator-App. Danach geht es hier direkt weiter.') }}

{{ __('Jetzt einrichten') }}
@endif