feat(auth): complete registration anti-spam and quota hardening
This commit is contained in:
@@ -91,10 +91,22 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
private function configureAuthRateLimiters(): void
|
||||
{
|
||||
RateLimiter::for('register-ip', function (Request $request): Limit {
|
||||
$limit = max(1, (int) config('registration.ip_per_minute_limit', 3));
|
||||
|
||||
return Limit::perMinute($limit)->by('register:ip:' . $request->ip());
|
||||
});
|
||||
|
||||
RateLimiter::for('register-ip-daily', function (Request $request): Limit {
|
||||
$limit = max(1, (int) config('registration.ip_per_day_limit', 20));
|
||||
|
||||
return Limit::perDay($limit)->by('register:ip:daily:' . $request->ip());
|
||||
});
|
||||
|
||||
RateLimiter::for('register', function (Request $request): array {
|
||||
$emailKey = strtolower((string) $request->input('email', 'unknown'));
|
||||
$ipLimit = (int) config('antispam.register.ip_per_minute', 20);
|
||||
$emailLimit = (int) config('antispam.register.email_per_minute', 6);
|
||||
$ipLimit = (int) config('registration.ip_per_minute_limit', 3);
|
||||
$emailLimit = (int) config('registration.email_per_minute_limit', 6);
|
||||
|
||||
return [
|
||||
Limit::perMinute($ipLimit)->by('register:ip:' . $request->ip()),
|
||||
|
||||
Reference in New Issue
Block a user