Merge pull request #4146 from sylvaindumont/patch-1

handle $2b$ in hashed password check
This commit is contained in:
Janny 2019-02-25 13:01:53 -05:00 committed by GitHub
commit c8a31e2725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1089,7 +1089,7 @@ module.exports = function(User) {
if (typeof plain !== 'string') {
return;
}
if (plain.indexOf('$2a$') === 0 && plain.length === 60) {
if ((plain.indexOf('$2a$') === 0 || plain.indexOf('$2b$') === 0) && plain.length === 60) {
// The password is already hashed. It can be the case
// when the instance is loaded from DB
this.$password = plain;