config('fortify.middleware', ['web'])], function () { // Login mit Livewire Route::livewire('/login', 'auth.login') ->middleware(['guest:'.config('fortify.guard')]) ->name('login'); // Ohne `guest` (Audit K-08): Ein eingeloggter Kunde, der seinen eigenen // Link öffnet (z. B. Bildbestätigung), soll auf dem Ziel landen; fremde // Links behandelt der Controller wie früher die guest-Middleware. Route::get('/magic-login/{token}', MagicLinkConsumeController::class) ->middleware(['throttle:10,1']) ->name('magic-links.consume'); // Anmeldung per E-Mail-Link (Magic-Link): zusammengeführte Seite für // Bestandskonten UND hinterlegte Pressekontakte ohne Account (WS-2). Route::livewire('/anmeldelink', 'auth.magic-link') ->middleware(['guest:'.config('fortify.guard')]) ->name('magic-link.request'); // Alte Pressekontakt-URL weiterleiten (Bestandslinks/Lesezeichen). Route::redirect('/pressekontakt-zugang', '/anmeldelink'); // Google-Login (WS-6) Route::get('/auth/google/redirect', [GoogleController::class, 'redirect']) ->middleware(['guest:'.config('fortify.guard')]) ->name('oauth.google.redirect'); Route::get('/auth/google/callback', [GoogleController::class, 'callback']) ->middleware(['guest:'.config('fortify.guard')]) ->name('oauth.google.callback'); // Bestätigte Erstverknüpfung eines bestehenden Kontos (Sicherheitsaudit // 07.10.2026, S-05): signierter Link aus der Mail, nur in der Session gültig, // die den Google-Login begonnen hat (SocialAccountLinker). Route::get('/auth/google/verknuepfen/{user}', [GoogleController::class, 'confirmLink']) ->middleware(['guest:'.config('fortify.guard'), 'signed', 'throttle:10,1']) ->whereNumber('user') ->name('oauth.google.confirm-link'); // Registrierung mit Livewire Route::livewire('/register', 'auth.register') ->middleware(['guest:'.config('fortify.guard')]) ->name('register'); // Passwort vergessen mit Livewire Route::livewire('/forgot-password', 'auth.forgot-password') ->middleware(['guest:'.config('fortify.guard')]) ->name('password.request'); // Passwort zurücksetzen mit Livewire Route::livewire('/reset-password/{token}', 'auth.reset-password') ->middleware(['guest:'.config('fortify.guard')]) ->name('password.reset'); // E-Mail-Verifizierung: Notice-/Danke-Seite (Volt) Route::livewire('/verify-email', 'auth.verify-email') ->middleware(['auth:'.config('fortify.guard')]) ->name('verification.notice'); // Signierter Bestätigungslink aus der Verifizierungsmail Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class) ->middleware(['auth:'.config('fortify.guard'), 'signed', 'throttle:6,1']) ->name('verification.verify'); // Bestätigungsmail erneut anfordern Route::post('/email/verification-notification', function () { request()->user()->sendEmailVerificationNotification(); return back()->with('status', 'verification-link-sent'); })->middleware(['auth:'.config('fortify.guard'), 'throttle:6,1']) ->name('verification.send'); // Signierter Bestätigungslink für eine E-Mail-Änderung (geht an die NEUE // Adresse; erst der Klick übernimmt sie ins Konto). Route::get('/email-aendern/{user}/{hash}', ConfirmEmailChangeController::class) ->middleware(['auth:'.config('fortify.guard'), 'signed', 'throttle:6,1']) ->name('email-change.confirm'); // 2FA-Challenge-Seite (Volt-Frontend für Fortifys two-factor-challenge); // der eigentliche POST geht an Fortifys Controller. Route::livewire('/two-factor-challenge', 'auth.two-factor-challenge') ->middleware(['guest:'.config('fortify.guard')]) ->name('two-factor.challenge'); // Passwort bestätigen mit Livewire Route::livewire('/confirm-password', 'auth.confirm-password') ->middleware(['auth:'.config('fortify.guard')]) ->name('password.confirm'); // Logout-Route Route::post('/logout', [AuthenticatedSessionController::class, 'destroy']) ->name('logout1'); });