From 215c458b564506080d95ffcead6e2e78a7096df6 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 20 Jan 2023 22:26:49 -0500 Subject: [PATCH] lowercase permissions --- api/ani/v1/routes/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/ani/v1/routes/user.js b/api/ani/v1/routes/user.js index 3a659c2..0e22ea6 100644 --- a/api/ani/v1/routes/user.js +++ b/api/ani/v1/routes/user.js @@ -30,7 +30,7 @@ module.exports = (app, router) => { const newUser = new Users({ id: req.params.id.toLowerCase(), name: req.body.name, - permissions: req.body.permissions, + permissions: req.body.permissions.map(permission => permission.toLowerCase()), discord: req.body.discord, password: hashSync(req.body.password, 8) }); @@ -93,5 +93,5 @@ module.exports = (app, router) => { req.user.permissions = permissions; req.user.markModified('permissions'); await req.user.save(); - }, (req, res, next) => {if (!req.authenticatedUser) {return res.status(401).send("You must be authenticated before you do that!");} next();})); + }, (req, res, next) => {if (!req.authenticatedUser) {return res.status(401).send("You must be authenticated before you do that!");} return next();})); }; \ No newline at end of file