I'm trying to disable rate limiting for Passport's built-in oauth/token
endpoint in Laravel 5.8, and I figured just removing the throttle middleware from api would do it:
'api' => [
// 'throttle:60,1',
'bindings',
],
But although this effectively disables rate limiting for every endpoint I've defined in my api routes file, it doesn't do it for /oauth/token
, as if Passport has a default throttling setting. So I just added the throttle middleware for that route in AppServiceProvider
with an absurd number:
\Route::group(['middleware' => ['custom_provider', 'throttle:999999999,1']], function () {
Passport::routes();
});
But when I test this I'm still getting 429 errors after a few requests for some reason:
429 Too Many Requests
X-RateLimit-Limit →9999999999
X-RateLimit-Remaining →9999999935
x-ratelimit-reset →1567108098
So I'd prefer to just disable this entirely. Any ideas how to disable it for Passport routes specifically?