Fixed crash when no password provided on account deletion

This commit is contained in:
2021-03-10 23:43:57 +11:00
parent da8bba93eb
commit 4581f0376a
+1 -1
View File
@@ -17,7 +17,7 @@ const route = async (req, res) => {
//compare the user's password
const compare = utils.promisify(bcrypt.compare);
const match = await compare(req.body.password, account.hash);
const match = await compare(req.body.password || '', account.hash);
if (!match) {
return res.status(401).send('incorrect password');