mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-02-11 07:38:57 +00:00
![Dan Brown](/assets/img/avatar_default.png)
Following Laravel guidance and GitHub diff. Not yet in tested state with app-specific changes made.
16 lines
391 B
PHP
16 lines
391 B
PHP
<?php
|
|
|
|
namespace BookStack\Http\Middleware;
|
|
|
|
use Illuminate\Routing\Middleware\ThrottleRequests as Middleware;
|
|
|
|
class ThrottleApiRequests extends Middleware
|
|
{
|
|
/**
|
|
* Resolve the number of attempts if the user is authenticated or not.
|
|
*/
|
|
protected function resolveMaxAttempts($request, $maxAttempts): int
|
|
{
|
|
return (int) config('api.requests_per_minute');
|
|
}
|
|
}
|