1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00

Update app/controllers/shared/api.php

Co-authored-by: kodumbeats <brandon.leckemby@gmail.com>
This commit is contained in:
Eldad A. Fux 2021-06-12 17:50:27 +03:00 committed by GitHub
parent 0a5646482f
commit babf31c3a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);