login attempts
This commit is contained in:
@@ -176,7 +176,7 @@ User.prototype.comparePassword = async function (password) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Account lockout constants
|
// Account lockout constants
|
||||||
const MAX_LOGIN_ATTEMPTS = 5;
|
const MAX_LOGIN_ATTEMPTS = 10;
|
||||||
const LOCK_TIME = 2 * 60 * 60 * 1000; // 2 hours
|
const LOCK_TIME = 2 * 60 * 60 * 1000; // 2 hours
|
||||||
|
|
||||||
// Check if account is locked
|
// Check if account is locked
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ router.post(
|
|||||||
if (user.isLocked()) {
|
if (user.isLocked()) {
|
||||||
return res.status(423).json({
|
return res.status(423).json({
|
||||||
error:
|
error:
|
||||||
"Account is temporarily locked due to too many failed login attempts. Please try again later.",
|
"Account is temporarily locked due to too many failed login attempts. Please try again in 2 hours.",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user