From 4581f0376a3c222a054048771b31ae4356853af6 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Wed, 10 Mar 2021 23:43:57 +1100 Subject: [PATCH] Fixed crash when no password provided on account deletion --- server/auth/deletion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/auth/deletion.js b/server/auth/deletion.js index feadc3d..239936b 100644 --- a/server/auth/deletion.js +++ b/server/auth/deletion.js @@ -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');