nodebb-plugin-sso-facebook 4.0.2 → 4.0.4
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/.gitattributes +22 -22
- package/LICENSE +7 -7
- package/README.md +6 -6
- package/library.js +5 -4
- package/package.json +1 -1
- package/static/lib/admin.js +25 -25
- package/templates/admin/plugins/sso-facebook.tpl +1 -3
package/.gitattributes
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
|
2
|
-
* text=auto
|
|
3
|
-
|
|
4
|
-
# Custom for Visual Studio
|
|
5
|
-
*.cs diff=csharp
|
|
6
|
-
*.sln merge=union
|
|
7
|
-
*.csproj merge=union
|
|
8
|
-
*.vbproj merge=union
|
|
9
|
-
*.fsproj merge=union
|
|
10
|
-
*.dbproj merge=union
|
|
11
|
-
|
|
12
|
-
# Standard to msysgit
|
|
13
|
-
*.doc diff=astextplain
|
|
14
|
-
*.DOC diff=astextplain
|
|
15
|
-
*.docx diff=astextplain
|
|
16
|
-
*.DOCX diff=astextplain
|
|
17
|
-
*.dot diff=astextplain
|
|
18
|
-
*.DOT diff=astextplain
|
|
19
|
-
*.pdf diff=astextplain
|
|
20
|
-
*.PDF diff=astextplain
|
|
21
|
-
*.rtf diff=astextplain
|
|
22
|
-
*.RTF diff=astextplain
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
|
3
|
+
|
|
4
|
+
# Custom for Visual Studio
|
|
5
|
+
*.cs diff=csharp
|
|
6
|
+
*.sln merge=union
|
|
7
|
+
*.csproj merge=union
|
|
8
|
+
*.vbproj merge=union
|
|
9
|
+
*.fsproj merge=union
|
|
10
|
+
*.dbproj merge=union
|
|
11
|
+
|
|
12
|
+
# Standard to msysgit
|
|
13
|
+
*.doc diff=astextplain
|
|
14
|
+
*.DOC diff=astextplain
|
|
15
|
+
*.docx diff=astextplain
|
|
16
|
+
*.DOCX diff=astextplain
|
|
17
|
+
*.dot diff=astextplain
|
|
18
|
+
*.DOT diff=astextplain
|
|
19
|
+
*.pdf diff=astextplain
|
|
20
|
+
*.PDF diff=astextplain
|
|
21
|
+
*.rtf diff=astextplain
|
|
22
|
+
*.RTF diff=astextplain
|
package/LICENSE
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Copyright (c) 2013-2014, psychobunny <psycho.bunny@hotmail.com>
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
1
|
+
Copyright (c) 2013-2014, psychobunny <psycho.bunny@hotmail.com>
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
8
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# NodeBB Facebook SSO
|
|
2
|
-
|
|
3
|
-
NodeBB Plugin that allows users to login/register via their Facebook account.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
1
|
+
# NodeBB Facebook SSO
|
|
2
|
+
|
|
3
|
+
NodeBB Plugin that allows users to login/register via their Facebook account.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
7
|
npm install nodebb-plugin-sso-facebook
|
package/library.js
CHANGED
|
@@ -227,6 +227,7 @@
|
|
|
227
227
|
|
|
228
228
|
Facebook.login = function (fbid, name, email, picture, accessToken, refreshToken, profile, callback) {
|
|
229
229
|
winston.verbose("Facebook.login fbid, name, email, picture: " + fbid + ", " + name + ", " + email + ", " + picture);
|
|
230
|
+
const autoConfirm = Facebook.settings && Facebook.settings.autoconfirm === "on" ? 1 : 0;
|
|
230
231
|
|
|
231
232
|
Facebook.getUidByFbid(fbid, function (err, uid) {
|
|
232
233
|
if (err) {
|
|
@@ -242,14 +243,14 @@
|
|
|
242
243
|
});
|
|
243
244
|
} else {
|
|
244
245
|
// New User
|
|
245
|
-
var success =
|
|
246
|
+
var success = async (uid) => {
|
|
246
247
|
// Save facebook-specific information to the user
|
|
247
248
|
user.setUserField(uid, 'fbid', fbid);
|
|
248
249
|
db.setObjectField('fbid:uid', fbid, uid);
|
|
249
|
-
var autoConfirm = Facebook.settings && Facebook.settings.autoconfirm === "on" ? 1 : 0;
|
|
250
250
|
|
|
251
251
|
if (autoConfirm) {
|
|
252
|
-
user.
|
|
252
|
+
await user.setUserField(uid, 'email', email);
|
|
253
|
+
await user.email.confirmByUid(uid);
|
|
253
254
|
}
|
|
254
255
|
|
|
255
256
|
// Save their photo, if present
|
|
@@ -276,7 +277,7 @@
|
|
|
276
277
|
return callback(new Error('[[error:sso-registration-disabled, Facebook]]'));
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
user.create({ username: name, email: email }, function (err, uid) {
|
|
280
|
+
user.create({ username: name, email: !autoConfirm ? email : undefined }, function (err, uid) {
|
|
280
281
|
if (err) {
|
|
281
282
|
return callback(err);
|
|
282
283
|
}
|
package/package.json
CHANGED
package/static/lib/admin.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
define('admin/plugins/sso-facebook', ['settings'], function(Settings) {
|
|
2
|
-
'use strict';
|
|
3
|
-
/* globals $, app, socket, require */
|
|
4
|
-
|
|
5
|
-
var ACP = {};
|
|
6
|
-
|
|
7
|
-
ACP.init = function() {
|
|
8
|
-
Settings.load('sso-facebook', $('.sso-facebook-settings'));
|
|
9
|
-
|
|
10
|
-
$('#save').on('click', function() {
|
|
11
|
-
Settings.save('sso-facebook', $('.sso-facebook-settings'), function() {
|
|
12
|
-
app.alert({
|
|
13
|
-
type: 'success',
|
|
14
|
-
alert_id: 'sso-facebook-saved',
|
|
15
|
-
title: 'Settings Saved',
|
|
16
|
-
message: 'Please reload your NodeBB to apply these settings',
|
|
17
|
-
clickfn: function() {
|
|
18
|
-
socket.emit('admin.reload');
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return ACP;
|
|
1
|
+
define('admin/plugins/sso-facebook', ['settings'], function(Settings) {
|
|
2
|
+
'use strict';
|
|
3
|
+
/* globals $, app, socket, require */
|
|
4
|
+
|
|
5
|
+
var ACP = {};
|
|
6
|
+
|
|
7
|
+
ACP.init = function() {
|
|
8
|
+
Settings.load('sso-facebook', $('.sso-facebook-settings'));
|
|
9
|
+
|
|
10
|
+
$('#save').on('click', function() {
|
|
11
|
+
Settings.save('sso-facebook', $('.sso-facebook-settings'), function() {
|
|
12
|
+
app.alert({
|
|
13
|
+
type: 'success',
|
|
14
|
+
alert_id: 'sso-facebook-saved',
|
|
15
|
+
title: 'Settings Saved',
|
|
16
|
+
message: 'Please reload your NodeBB to apply these settings',
|
|
17
|
+
clickfn: function() {
|
|
18
|
+
socket.emit('admin.reload');
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return ACP;
|
|
26
26
|
});
|