Skip to content

Commit

Permalink
Merge pull request #4146 from sylvaindumont/patch-1
Browse files Browse the repository at this point in the history
handle $2b$ in hashed password check
  • Loading branch information
Janny authored Feb 25, 2019
2 parents 1e33ec5 + 4226da5 commit c8a31e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c8a31e2

Please sign in to comment.