mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix bcrypt.compare usage
This commit is contained in:
parent
2ad3af1864
commit
51edb1ef19
@ -33,11 +33,11 @@ function authenticate() {
|
|||||||
if (args.length === 2) {
|
if (args.length === 2) {
|
||||||
// Username/password authentication
|
// Username/password authentication
|
||||||
var password = args[1];
|
var password = args[1];
|
||||||
return new Promise(function(resolve,reject) {
|
return bcrypt.compare(password, user.password).then(res => {
|
||||||
bcrypt.compare(password, user.password, function(err, res) {
|
return res ? cleanUser(user) : null
|
||||||
resolve(res?cleanUser(user):null);
|
}).catch(err => {
|
||||||
});
|
return null
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
// Try to extract common profile information
|
// Try to extract common profile information
|
||||||
if (args[0].hasOwnProperty('photos') && args[0].photos.length > 0) {
|
if (args[0].hasOwnProperty('photos') && args[0].photos.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user