Passwords now must be provided when registering a user

This commit is contained in:
Isaac Abadi
2020-11-29 18:37:16 -05:00
parent b0acb63123
commit 1542436e96

View File

@@ -89,6 +89,12 @@ exports.registerUser = function(req, res) {
return;
}
if (plaintextPassword === "") {
res.sendStatus(400);
logger.error(`Registration failed for user ${userid}. A password must be provided.`);
return;
}
bcrypt.hash(plaintextPassword, saltRounds)
.then(function(hash) {
let new_user = generateUserObject(userid, username, hash);