closes #14
This commit is contained in:
parent
427dbe9890
commit
7b45882aec
@ -229,18 +229,19 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
OAuth.deleteUserData = function(uid, callback) {
|
OAuth.deleteUserData = function(data, callback) {
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
async.apply(User.getUserField, uid, constants.name + 'Id'),
|
async.apply(User.getUserField, data.uid, constants.name + 'Id'),
|
||||||
function(oAuthIdToDelete, next) {
|
function(oAuthIdToDelete, next) {
|
||||||
db.deleteObjectField(constants.name + 'Id:uid', oAuthIdToDelete, next);
|
db.deleteObjectField(constants.name + 'Id:uid', oAuthIdToDelete, next);
|
||||||
}
|
}
|
||||||
], function(err) {
|
], function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
winston.error('[sso-oauth] Could not remove OAuthId data for uid ' + uid + '. Error: ' + err);
|
winston.error('[sso-oauth] Could not remove OAuthId data for uid ' + data.uid + '. Error: ' + err);
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
callback(null, uid);
|
|
||||||
|
callback(null, data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"url": "https://github.com/julianlam/nodebb-plugin-sso-oauth",
|
"url": "https://github.com/julianlam/nodebb-plugin-sso-oauth",
|
||||||
"library": "./library.js",
|
"library": "./library.js",
|
||||||
"hooks": [
|
"hooks": [
|
||||||
{ "hook": "filter:user.delete", "method": "deleteUserData" },
|
{ "hook": "static:user.delete", "method": "deleteUserData" },
|
||||||
{ "hook": "filter:auth.init", "method": "getStrategy" }
|
{ "hook": "filter:auth.init", "method": "getStrategy" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user