E-Mail-Verifizierung (Entscheidung 15.06.): - User implementiert MustVerifyEmail; Registrierung legt inaktives, rollenloses Konto an und leitet auf die Danke-/Notice-Seite; Registered-Event versendet die Verifizierungsmail. Bestätigter Link aktiviert das Konto + vergibt customer-Rolle (ActivateUserAfterVerification). Backfill-Migration setzt email_verified_at für alle Bestands-User (sonst würde die verified-Middleware ~59k aktive Legacy-User aussperren). Seeder-User verifiziert. Auth-Flow-Korrekturen: - Magic-Link-Consume: rollensicherer Redirect ohne intended() (Customer landete sonst per stale intended=/dashboard im 403-Admin-Bereich). - Guest-Redirect (bootstrap/app.php) rollen-/verifizierungsbewusst statt fix /dashboard – schließt die 403-Sackgasse auf /login und /register. - Logout auf der Notice-Seite via echtes POST-Formular statt Livewire-Action (behebt 419 beim Session-Invalidate). - Magic-Link-Anforderung über eigenes Modal mit separater E-Mail-Eingabe. - Unverifizierte Login-Versuche landen auf der Notice-Seite. Sicherheitsfix Legacy-Rollen: - UserImporter mappte Alt-Gruppe 2 (Self-Publisher) auf editor (= Admin-Zugriff). Mapping auf customer korrigiert; Daten-Migration stuft die 65.950 fälschlichen Legacy-Editoren auf customer herab. Echte admin/api-only bleiben unberührt. Tests: Registration, EmailVerification, Authentication (Guest-Redirect), MagicLinkLogin (Modal/Redirect/Regression), Legacy-Import (Gruppen-Mapping). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
59 lines
2 KiB
PHP
59 lines
2 KiB
PHP
<?php
|
||
|
||
use Illuminate\Support\Facades\Auth;
|
||
use Illuminate\Support\Facades\Session;
|
||
use Livewire\Attributes\Layout;
|
||
use Livewire\Volt\Component;
|
||
|
||
new #[Layout('components.layouts.auth.pressekonto', ['heading' => 'Danke für Ihre Registrierung', 'eyebrow' => 'Nur noch ein Schritt', 'showFromBanner' => false])] class extends Component {
|
||
/**
|
||
* Send an email verification notification to the user.
|
||
*/
|
||
public function sendVerification(): void
|
||
{
|
||
if (Auth::user()->hasVerifiedEmail()) {
|
||
$this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
|
||
|
||
return;
|
||
}
|
||
|
||
Auth::user()->sendEmailVerificationNotification();
|
||
|
||
Session::flash('status', 'verification-link-sent');
|
||
}
|
||
}; ?>
|
||
|
||
<div>
|
||
<p class="text-[13.5px] text-ink-2 leading-[1.65] !-mt-4 mb-6">
|
||
Ihr Konto wurde angelegt. Wir haben Ihnen einen Bestätigungslink an
|
||
<strong class="text-ink font-semibold">{{ Auth::user()?->email }}</strong>
|
||
gesendet. Bitte öffnen Sie die Mail und klicken Sie auf den Link – danach
|
||
wird Ihr Konto freigeschaltet und Sie landen direkt in Ihrem Dashboard.
|
||
</p>
|
||
|
||
@if (session('status') === 'verification-link-sent')
|
||
<div class="field-status mb-6" role="status">
|
||
Ein neuer Bestätigungslink wurde an Ihre E-Mail-Adresse versendet.
|
||
</div>
|
||
@endif
|
||
|
||
<div class="space-y-3">
|
||
<button
|
||
type="button"
|
||
wire:click="sendVerification"
|
||
wire:loading.attr="disabled"
|
||
wire:target="sendVerification"
|
||
class="auth-btn-primary"
|
||
>
|
||
<span wire:loading.remove wire:target="sendVerification">Bestätigungs-Mail erneut senden</span>
|
||
<span wire:loading wire:target="sendVerification">Mail wird gesendet …</span>
|
||
</button>
|
||
|
||
<form method="POST" action="{{ route('logout') }}">
|
||
@csrf
|
||
<button type="submit" class="auth-btn-outline">
|
||
Abmelden
|
||
</button>
|
||
</form>
|
||
</div>
|
||
</div>
|