Version 0.7.0 #1

Merged
kor-elf merged 90 commits from develop into main 2023-12-08 21:18:23 +06:00
Showing only changes of commit 5d61ab425e - Show all commits

View File

@ -42,7 +42,13 @@ class RouteServiceProvider extends ServiceProvider
protected function configureRateLimiting(): void
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
return Limit::perMinute(60)->by($request->user()?->id ?: $request->getClientIp());
});
RateLimiter::for('login', function (Request $request) {
return [
Limit::perHour(config('rate_limiting.login_max_request', 50))->by($request->getClientIp()),
Limit::perHour(config('rate_limiting.login_max_email_request', 10))->by($request->getClientIp() . '-' . $request->input('email')),
];
});
}
}