Konsolidierter, bereinigter Stand der Wissensbasis (docs/). Frischer Wurzel-Commit, um urheberrechtlich problematische Volltexte aus der Historie zu entfernen (die bisherige Historie bestand aus einem einzigen Initial-Commit). Enthaltene Änderungen (vgl. docs/_Steuerung/CHANGELOG.md, 2026-05-29): - Copyright-Hygiene: 25 Volltext-/Übersetzungsdateien (Sharp 14 Kap., Wala 11 Kap.) entfernt; je Quelle _Fundstellen-Index.md als Provenienzbeleg; Quellnachweise + Steuerungsdateien angepasst. - Konsistenz-Korrekturen: Reichweite 000-013 (Scorecard-Regeln), Rule-ID MW-WK-DIFF-101, Quellnachweis-Dateiverweis, Dok.000 v2.0.2. - Dateinamen-Normalisierung: Startdatei ohne Leerzeichen. Originale (Wala/Sharp E-Books) privat außerhalb des Repos archiviert. Co-authored-by: Cursor <cursoragent@cursor.com>
80 lines
2.4 KiB
PHP
80 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Actions\Fortify\CreateNewUser;
|
|
use App\Actions\Fortify\ResetUserPassword;
|
|
use Illuminate\Cache\RateLimiting\Limit;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\RateLimiter;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Illuminate\Support\Str;
|
|
use Laravel\Fortify\Fortify;
|
|
|
|
class FortifyServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
$this->configureActions();
|
|
$this->configureViews();
|
|
$this->configureRateLimiting();
|
|
}
|
|
|
|
/**
|
|
* Configure Fortify actions.
|
|
*/
|
|
private function configureActions(): void
|
|
{
|
|
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
|
|
Fortify::createUsersUsing(CreateNewUser::class);
|
|
}
|
|
|
|
/**
|
|
* Configure Fortify views.
|
|
*/
|
|
private function configureViews(): void
|
|
{
|
|
Fortify::loginView(fn () => view('pages::auth.login'));
|
|
Fortify::verifyEmailView(fn () => view('pages::auth.verify-email'));
|
|
Fortify::twoFactorChallengeView(fn () => view('pages::auth.two-factor-challenge'));
|
|
Fortify::confirmPasswordView(fn () => view('pages::auth.confirm-password'));
|
|
Fortify::registerView(fn () => view('pages::auth.register'));
|
|
Fortify::resetPasswordView(fn () => view('pages::auth.reset-password'));
|
|
Fortify::requestPasswordResetLinkView(fn () => view('pages::auth.forgot-password'));
|
|
}
|
|
|
|
/**
|
|
* Configure rate limiting.
|
|
*/
|
|
private function configureRateLimiting(): void
|
|
{
|
|
RateLimiter::for('two-factor', function (Request $request) {
|
|
return Limit::perMinute(5)->by($request->session()->get('login.id'));
|
|
});
|
|
|
|
RateLimiter::for('login', function (Request $request) {
|
|
$throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())).'|'.$request->ip());
|
|
|
|
return Limit::perMinute(5)->by($throttleKey);
|
|
});
|
|
|
|
RateLimiter::for('passkeys', function (Request $request) {
|
|
$credentialId = $request->input('credential.id');
|
|
|
|
return Limit::perMinute(10)->by(
|
|
($credentialId ?: $request->session()->getId()).'|'.$request->ip(),
|
|
);
|
|
});
|
|
}
|
|
}
|