add brute-force protection for change password and email actions

v1.18.x
Julian Lam 7 years ago
parent d0c22c5bd3
commit 7558046e75

@ -33,7 +33,16 @@ module.exports = function (User) {
function (next) {
Password.compare(password, hashedPassword, next);
},
], callback);
], function (err, ok) {
if (err) {
return callback(err);
}
// Delay return for incorrect current password
setTimeout(function () {
callback(null, ok);
}, ok ? 0 : 2500);
});
};
User.hasPassword = function (uid, callback) {

Loading…
Cancel
Save