needs to be async
This commit is contained in:
parent
2e451d8fd0
commit
f09daaa3de
@ -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);
|
||||
|
||||
@ -95,7 +95,7 @@ router.put(
|
||||
var body = req.body as MessageCreateSchema;
|
||||
const attachments: Attachment[] = [];
|
||||
|
||||
const rights = getRights(req.user_id);
|
||||
const rights = await getRights(req.user_id);
|
||||
rights.hasThrow("SEND_MESSAGES");
|
||||
|
||||
// regex to check if message contains anything other than numerals ( also no decimals )
|
||||
|
||||
BIN
bundle/package-lock.json
generated
BIN
bundle/package-lock.json
generated
Binary file not shown.
Reference in New Issue
Block a user