Update app/controllers/shared/api.php
Co-authored-by: kodumbeats <brandon.leckemby@gmail.com>
This commit is contained in:
parent
0a5646482f
commit
babf31c3a3
|
@ -65,7 +65,7 @@ App::init(function ($utopia, $request, $response, $project, $user, $register, $e
|
|||
$isAppUser = Auth::isAppUser(Authorization::$roles);
|
||||
|
||||
if (($abuse->check() // Route is rate-limited
|
||||
&& App::getEnv('_APP_OPTIONS_ABUSE', 'enabled') !== 'disabled') // Abuse is not diabled
|
||||
&& App::getEnv('_APP_OPTIONS_ABUSE', 'enabled') !== 'disabled') // Abuse is not disabled
|
||||
&& (!$isAppUser && !$isPrivilegedUser)) // User is not an admin or API key
|
||||
{
|
||||
throw new Exception('Too many requests', 429);
|
||||
|
|
Loading…
Reference in a new issue