|
|
|
@ -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();})); |
|
|
|
|
}; |