nodebb-plugin-sso-github 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library.js +11 -25
- package/package.json +2 -2
package/library.js
CHANGED
|
@@ -219,37 +219,23 @@
|
|
|
219
219
|
service: "GitHub",
|
|
220
220
|
});
|
|
221
221
|
});
|
|
222
|
-
data.router.post('/deauth/github', [data.middleware.requireUser, data.middleware.applyCSRF], function (req, res
|
|
223
|
-
GitHub.deleteUserData({
|
|
222
|
+
data.router.post('/deauth/github', [data.middleware.requireUser, data.middleware.applyCSRF], hostHelpers.tryRoute(async function (req, res) {
|
|
223
|
+
await GitHub.deleteUserData({
|
|
224
224
|
uid: req.user.uid,
|
|
225
|
-
}, function (err) {
|
|
226
|
-
if (err) {
|
|
227
|
-
return next(err);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
res.redirect(nconf.get('relative_path') + '/me/edit');
|
|
231
225
|
});
|
|
232
|
-
|
|
226
|
+
res.redirect(nconf.get('relative_path') + '/me/edit');
|
|
227
|
+
}));
|
|
233
228
|
|
|
234
229
|
callback();
|
|
235
230
|
};
|
|
236
231
|
|
|
237
|
-
GitHub.deleteUserData = function(data
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
},
|
|
245
|
-
async.apply(db.deleteObjectField, 'user:' + uid, 'githubid'),
|
|
246
|
-
], function(err) {
|
|
247
|
-
if (err) {
|
|
248
|
-
winston.error('[sso-github] Could not remove OAuthId data for uid ' + uid + '. Error: ' + err);
|
|
249
|
-
return callback(err);
|
|
250
|
-
}
|
|
251
|
-
callback(null, uid);
|
|
252
|
-
});
|
|
232
|
+
GitHub.deleteUserData = async function(data) {
|
|
233
|
+
const { uid } = data;
|
|
234
|
+
const githubid = await User.getUserField(uid, 'githubid');
|
|
235
|
+
if (githubid) {
|
|
236
|
+
await db.deleteObjectField('githubid:uid', oAuthIdToDelete, next);
|
|
237
|
+
await db.deleteObjectField('user:' + uid, 'githubid');
|
|
238
|
+
}
|
|
253
239
|
};
|
|
254
240
|
|
|
255
241
|
module.exports = GitHub;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-sso-github",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "NodeBB GitHub SSO",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"repository": {
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
"passport-github2": "^0.1.9"
|
|
47
47
|
},
|
|
48
48
|
"nbbpm": {
|
|
49
|
-
"compatibility": "^
|
|
49
|
+
"compatibility": "^4.0.0"
|
|
50
50
|
}
|
|
51
51
|
}
|