Fixed crash when no password provided on account deletion
This commit is contained in:
@@ -17,7 +17,7 @@ const route = async (req, res) => {
|
|||||||
|
|
||||||
//compare the user's password
|
//compare the user's password
|
||||||
const compare = utils.promisify(bcrypt.compare);
|
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) {
|
if (!match) {
|
||||||
return res.status(401).send('incorrect password');
|
return res.status(401).send('incorrect password');
|
||||||
|
|||||||
Reference in New Issue
Block a user