From a94f7c76172d83b95f43b059b9a5af4299eb2f8d Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 14 Feb 2021 19:01:41 +0100 Subject: switch to mongoose --- src/middlewares/RateLimit.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/middlewares/RateLimit.ts') diff --git a/src/middlewares/RateLimit.ts b/src/middlewares/RateLimit.ts index c42d773c..b015c7e0 100644 --- a/src/middlewares/RateLimit.ts +++ b/src/middlewares/RateLimit.ts @@ -5,6 +5,9 @@ import { getIpAdress } from "./GlobalRateLimit"; export function RateLimit({ count = 10, timespan = 1000 * 5, name = "/" }) { return async (req: Request, res: Response, next: NextFunction) => { + return next(); + // TODO: use new db mongoose models + let id = req.userid || getIpAdress(req); const limit: { count: number; start: number } = (await db.data.ratelimit.routes[name][id].get()) || { -- cgit 1.5.1