diff options
Diffstat (limited to 'api/src/middlewares/RateLimit.ts')
-rw-r--r-- | api/src/middlewares/RateLimit.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/api/src/middlewares/RateLimit.ts b/api/src/middlewares/RateLimit.ts index 7d5c51e2..ca6de98f 100644 --- a/api/src/middlewares/RateLimit.ts +++ b/api/src/middlewares/RateLimit.ts @@ -46,7 +46,8 @@ export default function rateLimit(opts: { }): any { return async (req: Request, res: Response, next: NextFunction): Promise<any> => { // exempt user? if so, immediately short circuit - if (getRights(req.user_id).has("BYPASS_RATE_LIMITS")) return; + const rights = await getRights(req.user_id); + if (rights.has("BYPASS_RATE_LIMITS")) return; const bucket_id = opts.bucket || req.originalUrl.replace(API_PREFIX_TRAILING_SLASH, ""); var executor_id = getIpAdress(req); |