This commit is contained in:
Akif9748 2022-09-05 23:44:38 +03:00
parent 0fba3dca03
commit 538108da94

View file

@ -36,7 +36,7 @@ app.use(
next(); next();
}, rateLimit({ }, rateLimit({
windowMs: 60_000, max: 10, windowMs: 60_000, max: 10,
handler: (req, res, next, opts) => !req.user.admin ? res.error(opts.statusCode, "You are begin ratelimited") : next() handler: (req, res, next, opts) => !req.user?.admin ? res.error(opts.statusCode, "You are begin ratelimited") : next()
}), bodyParser.urlencoded({ extended: true }) }), bodyParser.urlencoded({ extended: true })
); );