mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
add blacklist test to onSuccessfulLogin as well
This commit is contained in:
@@ -274,7 +274,6 @@ authenticationController.doLogin = function (req, uid, callback) {
|
||||
};
|
||||
|
||||
authenticationController.onSuccessfulLogin = function (req, uid, callback) {
|
||||
callback = callback || function () {};
|
||||
var uuid = utils.generateUUID();
|
||||
req.session.meta = {};
|
||||
|
||||
@@ -294,6 +293,7 @@ authenticationController.onSuccessfulLogin = function (req, uid, callback) {
|
||||
});
|
||||
|
||||
async.waterfall([
|
||||
async.apply(meta.blacklist.test, req.ip),
|
||||
function (next) {
|
||||
async.parallel([
|
||||
function (next) {
|
||||
@@ -316,7 +316,17 @@ authenticationController.onSuccessfulLogin = function (req, uid, callback) {
|
||||
plugins.fireHook('action:user.loggedIn', { uid: uid, req: req });
|
||||
next();
|
||||
},
|
||||
], callback);
|
||||
], function (err) {
|
||||
if (err) {
|
||||
req.session.destroy();
|
||||
}
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
callback(err);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
authenticationController.localLogin = function (req, username, password, next) {
|
||||
|
||||
Reference in New Issue
Block a user