Return UAA error to Security Context layer

This commit is contained in:
Tan Jiang 2018-02-05 21:00:19 +08:00
parent 87ca267b0f
commit 40b6cb0d43

View File

@ -104,10 +104,12 @@ func Login(m models.AuthModel) (*models.User, error) {
return nil, nil
}
user, err := authenticator.Authenticate(m)
if user == nil && err == nil {
if user == nil {
if err == nil {
log.Debugf("Login failed, locking %s, and sleep for %v", m.Principal, frozenTime)
lock.Lock(m.Principal)
time.Sleep(frozenTime)
}
return user, err
}