Minor bugfixes

This commit is contained in:
2021-01-27 01:52:18 +11:00
parent 8c754b4570
commit 6468b02647
4 changed files with 15 additions and 8 deletions
+5 -1
View File
@@ -24,12 +24,16 @@ const route = async (req, res) => {
}
});
if (!account) {
return res.status(401).send('incorrect email or password');
}
//compare passwords
const compare = utils.promisify(bcrypt.compare);
const match = await compare(req.fields.password, account.hash);
if (!match) {
return res.status(401).send('passwords don\'t match');
return res.status(401).send('incorrect email or password');
}
//save the session and cookie data