handle $2b$ in hashed password check
bcrypt made $2b$ the default in bcrypt 2.0.0
This commit is contained in:
parent
1e33ec596f
commit
4226da5fc4
|
@ -1089,7 +1089,7 @@ module.exports = function(User) {
|
||||||
if (typeof plain !== 'string') {
|
if (typeof plain !== 'string') {
|
||||||
return;
|
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
|
// The password is already hashed. It can be the case
|
||||||
// when the instance is loaded from DB
|
// when the instance is loaded from DB
|
||||||
this.$password = plain;
|
this.$password = plain;
|
||||||
|
|
Loading…
Reference in New Issue