Disable login of blocked users

This commit is contained in:
cuigh 2018-12-04 14:12:56 +08:00
parent ce196dd274
commit 70b81522fa

View File

@ -31,6 +31,10 @@ func Validator(setting *model.Setting) func(name, pwd string) (ticket string, er
return return
} }
if mu != nil && mu.Status == model.UserStatusBlocked {
return "", certify.ErrAccountDisabled
}
if mu != nil && mu.Type == model.UserTypeInternal { // internal user if mu != nil && mu.Type == model.UserTypeInternal { // internal user
if !passwd.Validate(pwd, mu.Password, mu.Salt) { if !passwd.Validate(pwd, mu.Password, mu.Salt) {
err = certify.ErrInvalidToken err = certify.ErrInvalidToken