login-validator: Fix invalid error returned
This commit is contained in:
parent
d5a67e2bbb
commit
0cbe2ba9c0
@ -49,9 +49,9 @@ func (f *Krb5Auth) checkAuth(username, password string) (res bool, err error) {
|
|||||||
if err := c.Login(); err != nil {
|
if err := c.Login(); err != nil {
|
||||||
if errk, ok := err.(krberror.Krberror); ok {
|
if errk, ok := err.(krberror.Krberror); ok {
|
||||||
if errk.RootCause == krberror.NetworkingError {
|
if errk.RootCause == krberror.NetworkingError {
|
||||||
return false, errors.New(`{"status": "Authentication system unavailable, please retry."}`)
|
return false, errors.New("Authentication system unavailable, please retry")
|
||||||
} else if errk.RootCause == krberror.KDCError {
|
} else if errk.RootCause == krberror.KDCError {
|
||||||
return false, errors.New(`{"status": "Invalid username or password"}`)
|
return false, errors.New("Invalid username or password")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false, err
|
return false, err
|
||||||
|
Reference in New Issue
Block a user