This commit is contained in:
Brian Ross 2017-06-04 20:01:20 +00:00 committed by GitHub
commit a68cad21e0
1 changed files with 2 additions and 2 deletions
common/models

View File

@ -1059,8 +1059,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