From 0b2086e09da5b4a3bba3b7fa112df99033db519c Mon Sep 17 00:00:00 2001 From: Nick Magerko Date: Sat, 28 Jan 2017 23:49:14 -0600 Subject: [PATCH] fix: stop generating passwords for all new users --- api/v1/services/UserService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v1/services/UserService.js b/api/v1/services/UserService.js index aedbd45..097e23c 100644 --- a/api/v1/services/UserService.js +++ b/api/v1/services/UserService.js @@ -19,7 +19,7 @@ var utils = require('../utils'); module.exports.createUser = function (email, password, role) { email = email.toLowerCase(); - var storedPassword = (storedPassword) ? storedPassword : utils.crypto.generatePassword(); + var storedPassword = (password) ? password : utils.crypto.generatePassword(); var user = User.forge({ email: email, password: storedPassword }); return user .validate() @@ -40,7 +40,7 @@ module.exports.createUser = function (email, password, role) { // TODO: send user an email requiring a password reset when // the password is automatically generated } - + return _Promise.resolve(result); }); };