Merge branch 'master' of github.com:Fastinyoh/nodebb-plugin-sso-oauth into Fastinyoh-master
Conflicts: plugin.json
This commit is contained in:
commit
28a8874e01
16
library.js
16
library.js
@ -10,6 +10,7 @@
|
|||||||
path = module.parent.require('path'),
|
path = module.parent.require('path'),
|
||||||
nconf = module.parent.require('nconf'),
|
nconf = module.parent.require('nconf'),
|
||||||
winston = module.parent.require('winston'),
|
winston = module.parent.require('winston'),
|
||||||
|
async = module.parent.require('async'),
|
||||||
passportOAuth;
|
passportOAuth;
|
||||||
|
|
||||||
var constants = Object.freeze({
|
var constants = Object.freeze({
|
||||||
@ -256,5 +257,20 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
OAuth.deleteUserData = function(uid, callback) {
|
||||||
|
async.waterfall([
|
||||||
|
async.apply(User.getUserField, uid, 'oAuthid'),
|
||||||
|
function(oAuthIdToDelete, next) {
|
||||||
|
db.deleteObjectField('oAuthid:uid', oAuthIdToDelete, next);
|
||||||
|
}
|
||||||
|
], function(err) {
|
||||||
|
if (err) {
|
||||||
|
winston.error('Could not remove OAuthId data for uid ' + uid + '. Error: ' + err);
|
||||||
|
return callback(err);
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = OAuth;
|
module.exports = OAuth;
|
||||||
}(module));
|
}(module));
|
@ -6,6 +6,7 @@
|
|||||||
"library": "./library.js",
|
"library": "./library.js",
|
||||||
"hooks": [
|
"hooks": [
|
||||||
{ "hook": "filter:app.load", "method": "init" },
|
{ "hook": "filter:app.load", "method": "init" },
|
||||||
|
{ "hook": "filter:user.delete", "method": "deleteUserData" },
|
||||||
{ "hook": "filter:auth.init", "method": "getStrategy" },
|
{ "hook": "filter:auth.init", "method": "getStrategy" },
|
||||||
{ "hook": "filter:admin.header.build", "method": "addMenuItem" }
|
{ "hook": "filter:admin.header.build", "method": "addMenuItem" }
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user