mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #10013 from swordqiu/hotfix/qj-no-pass-user-can-login
fix(keystone): user create without password can login with any password
This commit is contained in:
@@ -299,10 +299,10 @@ func VerifyPassword(user *api.SUserExtended, passwd string) error {
|
||||
func localUserVerifyPassword(user *api.SUserExtended, passwd string) error {
|
||||
passes, err := PasswordManager.fetchByLocaluserId(user.LocalId)
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrap(err, "fetchPassword")
|
||||
}
|
||||
if len(passes) == 0 {
|
||||
return nil
|
||||
return errors.Error("no valid password")
|
||||
}
|
||||
// password expiration check skip system account
|
||||
if passes[0].IsExpired() && !user.IsSystemAccount {
|
||||
|
||||
Reference in New Issue
Block a user