bugfix: auth password history size (#607)

master
yubo 4 years ago committed by GitHub
parent ff194c0382
commit b85b1e44ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -158,8 +158,11 @@ func (p *Authenticator) ChangePassword(user *models.User, password string) (err
}
if p.extraMode {
for _, v := range passwords {
if user.Password == v {
for i, pwd := range passwords {
if i >= cf.PwdHistorySize {
break
}
if user.Password == pwd {
err = _e("The password is the same as the old password")
return
}

Loading…
Cancel
Save