mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
fix: do not throw if password passed into isPasswordCorrect is invalid, just return false
This commit is contained in:
@@ -26,7 +26,12 @@ module.exports = function (User) {
|
|||||||
hashedPassword = '';
|
hashedPassword = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
User.isPasswordValid(password, 0);
|
try {
|
||||||
|
User.isPasswordValid(password, 0);
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
await User.auth.logAttempt(uid, ip);
|
await User.auth.logAttempt(uid, ip);
|
||||||
const ok = await Password.compare(password, hashedPassword, !!parseInt(shaWrapped, 10));
|
const ok = await Password.compare(password, hashedPassword, !!parseInt(shaWrapped, 10));
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user