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.apply(User.getUserField, uid, constants.name + 'Id'),
|
||||
async.apply(User.getUserField, data.uid, constants.name + 'Id'),
|
||||
function(oAuthIdToDelete, next) {
|
||||
db.deleteObjectField(constants.name + 'Id:uid', oAuthIdToDelete, next);
|
||||
}
|
||||
], function(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);
|
||||
}
|
||||
callback(null, uid);
|
||||
|
||||
callback(null, data);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
"url": "https://github.com/julianlam/nodebb-plugin-sso-oauth",
|
||||
"library": "./library.js",
|
||||
"hooks": [
|
||||
{ "hook": "filter:user.delete", "method": "deleteUserData" },
|
||||
{ "hook": "static:user.delete", "method": "deleteUserData" },
|
||||
{ "hook": "filter:auth.init", "method": "getStrategy" }
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user