mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-09-01 04:56:52 +02:00
closes #1971
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var db = require('../database'),
|
||||
var async = require('async'),
|
||||
db = require('../database'),
|
||||
meta = require('../meta');
|
||||
|
||||
module.exports = function(User) {
|
||||
@@ -42,4 +43,11 @@ module.exports = function(User) {
|
||||
User.auth.clearLoginAttempts = function(uid) {
|
||||
db.delete('loginAttempts:' + uid);
|
||||
};
|
||||
|
||||
User.auth.resetLockout = function(uid, callback) {
|
||||
async.parallel([
|
||||
async.apply(db.delete, 'loginAttemps:' + uid),
|
||||
async.apply(db.delete, 'lockout:' + uid)
|
||||
], callback);
|
||||
}
|
||||
};
|
||||
@@ -88,10 +88,8 @@ var async = require('async'),
|
||||
|
||||
db.deleteObjectField('reset:uid', code);
|
||||
db.deleteObjectField('reset:expiry', code);
|
||||
db.delete('lockout:' + uid);
|
||||
user.auth.clearLoginAttempts(uid);
|
||||
|
||||
callback();
|
||||
user.auth.resetLockout(uid, callback);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user