From 84a77071eac54c1d31919a16f3fb62f56e09d565 Mon Sep 17 00:00:00 2001 From: Brian Ross Date: Wed, 11 May 2016 09:05:33 -0700 Subject: [PATCH] Allow passwords to be all numbers Allow number passwords by converting number to string before hashing. --- common/models/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/models/user.js b/common/models/user.js index c1911ee8..b61a5587 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -604,8 +604,8 @@ module.exports = function(User) { }; UserModel.setter.password = function(plain) { - if (typeof plain !== 'string') { - return; + if (typeof plain === 'number') { + plain = plain.toString(); } if (plain.indexOf('$2a$') === 0 && plain.length === 60) { // The password is already hashed. It can be the case