diff --git a/packages/node_modules/@node-red/editor-api/lib/auth/users.js b/packages/node_modules/@node-red/editor-api/lib/auth/users.js index 9b0b316ec..e85132d17 100644 --- a/packages/node_modules/@node-red/editor-api/lib/auth/users.js +++ b/packages/node_modules/@node-red/editor-api/lib/auth/users.js @@ -33,11 +33,11 @@ function authenticate() { if (args.length === 2) { // Username/password authentication var password = args[1]; - return new Promise(function(resolve,reject) { - bcrypt.compare(password, user.password, function(err, res) { - resolve(res?cleanUser(user):null); - }); - }); + return bcrypt.compare(password, user.password).then(res => { + return res ? cleanUser(user) : null + }).catch(err => { + return null + }) } else { // Try to extract common profile information if (args[0].hasOwnProperty('photos') && args[0].photos.length > 0) {