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 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 = function (uid) {
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.email.confirmByUid(uid);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-sso-facebook",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "NodeBB Facebook SSO",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -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
  });
@@ -51,6 +51,4 @@
51
51
  </div>
52
52
  </div>
53
53
 
54
- <button id="save" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
55
- <i class="material-icons">save</i>
56
- </button>
54
+ <!-- IMPORT admin/partials/save_button.tpl -->