Update ApiV1Dot1Controller, add configurable app confirm rate limit ttl

This commit is contained in:
Daniel Supernault 2023-10-29 05:29:30 -06:00
parent 1686fc68e8
commit 4c6a0719ca
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -602,8 +602,8 @@ class ApiV1Dot1Controller extends Controller
abort_if(BouncerService::checkIp($request->ip()), 404); abort_if(BouncerService::checkIp($request->ip()), 404);
} }
$rl = RateLimiter::attempt('pf:apiv1.1:iarc:'.$request->ip(), 10, function(){}, 1800); $rl = RateLimiter::attempt('pf:apiv1.1:iarc:'.$request->ip(), config('pixelfed.app_registration_confirm_rate_limit_attempts', 20), function(){}, config('pixelfed.app_registration_confirm_rate_limit_decay', 1800));
abort_if(!$rl, 400, 'Too many requests'); abort_if(!$rl, 429, 'Too many requests');
$this->validate($request, [ $this->validate($request, [
'user_token' => 'required', 'user_token' => 'required',