diff --git a/red/api/auth/clients.js b/red/api/auth/clients.js index 4495efba0..63e59ccce 100644 --- a/red/api/auth/clients.js +++ b/red/api/auth/clients.js @@ -13,8 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ - -var when = require("when"); var clients = [ {id:"node-red-editor",secret:"not_available"}, @@ -25,9 +23,9 @@ module.exports = { get: function(id) { for (var i=0;i 0) { - user.image = arguments[0].photos[0].value; + } else { + // Try to extract common profile information + if (args[0].hasOwnProperty('photos') && args[0].photos.length > 0) { + user.image = args[0].photos[0].value; + } + return cleanUser(user); } - return when.resolve(user); } - } - return when.resolve(null); + return null; + }); } function get(username) { - return when.resolve(users[username]); + return Promise.resolve(users[username]); } function getDefaultUser() { - return when.resolve(null); + return Promise.resolve(null); } var api = { @@ -63,7 +64,6 @@ var api = { function init(config) { users = {}; - passwords = {}; defaultUser = null; if (config.type == "credentials" || config.type == "strategy") { if (config.users) { @@ -77,11 +77,7 @@ function init(config) { } for (var i=0;i