nodebb-plugin-sso-facebook 4.2.0 → 5.0.0
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 +12 -11
- package/package.json +4 -4
- package/templates/plugins/sso-facebook/deauth.tpl +3 -3
package/library.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
const passport =
|
|
4
|
+
const passport = nodebb.require('passport');
|
|
5
5
|
const passportFacebook = require('passport-facebook').Strategy;
|
|
6
|
-
const nconf =
|
|
7
|
-
const winston =
|
|
6
|
+
const nconf = nodebb.require('nconf');
|
|
7
|
+
const winston = nodebb.require('winston');
|
|
8
8
|
|
|
9
|
-
const user =
|
|
10
|
-
const meta =
|
|
11
|
-
const db =
|
|
9
|
+
const user = nodebb.require('./src/user');
|
|
10
|
+
const meta = nodebb.require('./src/meta');
|
|
11
|
+
const db = nodebb.require('./src/database');
|
|
12
12
|
|
|
13
13
|
const constants = Object.freeze({
|
|
14
14
|
'name': 'Facebook',
|
|
@@ -23,7 +23,7 @@ const Facebook = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
Facebook.init = async function (params) {
|
|
26
|
-
const hostHelpers =
|
|
26
|
+
const hostHelpers = nodebb.require('./src/routes/helpers');
|
|
27
27
|
|
|
28
28
|
hostHelpers.setupAdminPageRoute(params.router, '/admin/plugins/sso-facebook', function (req, res) {
|
|
29
29
|
res.render('admin/plugins/sso-facebook', {
|
|
@@ -56,7 +56,7 @@ Facebook.getSettings = async function () {
|
|
|
56
56
|
Facebook.getStrategy = async function (strategies) {
|
|
57
57
|
if (!Facebook.settings) {
|
|
58
58
|
await Facebook.getSettings();
|
|
59
|
-
return Facebook.getStrategy(strategies);
|
|
59
|
+
return await Facebook.getStrategy(strategies);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (
|
|
@@ -128,6 +128,7 @@ Facebook.getStrategy = async function (strategies) {
|
|
|
128
128
|
scope: 'public_profile, email',
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
+
return strategies;
|
|
131
132
|
};
|
|
132
133
|
|
|
133
134
|
Facebook.appendUserHashWhitelist = function (data) {
|
|
@@ -294,9 +295,9 @@ Facebook.getUidByFbid = async function (fbid) {
|
|
|
294
295
|
|
|
295
296
|
Facebook.addMenuItem = function (custom_header) {
|
|
296
297
|
custom_header.authentication.push({
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
route: constants.admin.route,
|
|
299
|
+
icon: constants.admin.icon,
|
|
300
|
+
name: constants.name,
|
|
300
301
|
});
|
|
301
302
|
return custom_header;
|
|
302
303
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-sso-facebook",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "NodeBB Facebook SSO",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"repository": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"passport-facebook": "~1.0.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"eslint": "10.0
|
|
36
|
-
"eslint-config-nodebb": "^2.0.
|
|
35
|
+
"eslint": "10.7.0",
|
|
36
|
+
"eslint-config-nodebb": "^2.0.3"
|
|
37
37
|
},
|
|
38
38
|
"nbbpm": {
|
|
39
|
-
"compatibility": "^4.
|
|
39
|
+
"compatibility": "^4.14.0"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<div class="col-12 col-sm-8 col-offset-sm-2 col-md-6 col-offset-md-3">
|
|
2
2
|
<div class="card">
|
|
3
3
|
<div class="card-header">
|
|
4
|
-
<span class="fs-4">
|
|
4
|
+
<span class="fs-4">{{tx("user:sso.dissociate-confirm-title")}}</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="card-body">
|
|
7
|
-
|
|
7
|
+
{{tx("user:sso.dissociate-confirm", service)}}
|
|
8
8
|
|
|
9
9
|
<hr>
|
|
10
10
|
|
|
11
11
|
<form method="post">
|
|
12
12
|
<input type="hidden" name="_csrf" value="{config.csrf_token}" />
|
|
13
|
-
<button class="btn btn-danger">
|
|
13
|
+
<button class="btn btn-danger">{{tx("user:sso.dissociate")}}</button>
|
|
14
14
|
</form>
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|