@node-red/editor-api 4.0.0-beta.4 → 4.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/lib/auth/users.js +6 -6
- package/package.json +5 -5
package/lib/auth/users.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
var util = require("util");
|
|
18
18
|
var clone = require("clone");
|
|
19
19
|
var bcrypt;
|
|
20
|
-
try { bcrypt = require('bcrypt'); }
|
|
20
|
+
try { bcrypt = require('@node-rs/bcrypt'); }
|
|
21
21
|
catch(e) { bcrypt = require('bcryptjs'); }
|
|
22
22
|
var users = {};
|
|
23
23
|
var defaultUser = null;
|
|
@@ -33,11 +33,11 @@ function authenticate() {
|
|
|
33
33
|
if (args.length === 2) {
|
|
34
34
|
// Username/password authentication
|
|
35
35
|
var password = args[1];
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
36
|
+
return bcrypt.compare(password, user.password).then(res => {
|
|
37
|
+
return res ? cleanUser(user) : null
|
|
38
|
+
}).catch(err => {
|
|
39
|
+
return null
|
|
40
|
+
})
|
|
41
41
|
} else {
|
|
42
42
|
// Try to extract common profile information
|
|
43
43
|
if (args[0].hasOwnProperty('photos') && args[0].photos.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-red/editor-api",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@node-red/util": "4.0.0
|
|
20
|
-
"@node-red/editor-client": "4.0.0
|
|
19
|
+
"@node-red/util": "4.0.0",
|
|
20
|
+
"@node-red/editor-client": "4.0.0",
|
|
21
21
|
"bcryptjs": "2.4.3",
|
|
22
22
|
"body-parser": "1.20.2",
|
|
23
23
|
"clone": "2.1.2",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"passport-http-bearer": "1.0.1",
|
|
33
33
|
"passport-oauth2-client-password": "0.1.2",
|
|
34
34
|
"passport": "0.7.0",
|
|
35
|
-
"ws": "7.5.
|
|
35
|
+
"ws": "7.5.10"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"bcrypt": "
|
|
38
|
+
"@node-rs/bcrypt": "1.10.4"
|
|
39
39
|
}
|
|
40
40
|
}
|