feat(auth): use the same error message on invalid authentication (#1024)
parent
536ca15e90
commit
5d749c2ebf
|
@ -75,7 +75,7 @@ func (handler *AuthHandler) handlePostAuth(w http.ResponseWriter, r *http.Reques
|
||||||
|
|
||||||
u, err := handler.UserService.UserByUsername(username)
|
u, err := handler.UserService.UserByUsername(username)
|
||||||
if err == portainer.ErrUserNotFound {
|
if err == portainer.ErrUserNotFound {
|
||||||
httperror.WriteErrorResponse(w, err, http.StatusNotFound, handler.Logger)
|
httperror.WriteErrorResponse(w, ErrInvalidCredentials, http.StatusBadRequest, handler.Logger)
|
||||||
return
|
return
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
httperror.WriteErrorResponse(w, err, http.StatusInternalServerError, handler.Logger)
|
httperror.WriteErrorResponse(w, err, http.StatusInternalServerError, handler.Logger)
|
||||||
|
|
Loading…
Reference in New Issue