feat(auth): use the same error message on invalid authentication (#1024)

pull/1025/head
Anthony Lapenna 2017-07-12 17:22:14 +02:00 committed by GitHub
parent 536ca15e90
commit 5d749c2ebf
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ func (handler *AuthHandler) handlePostAuth(w http.ResponseWriter, r *http.Reques
u, err := handler.UserService.UserByUsername(username)
if err == portainer.ErrUserNotFound {
httperror.WriteErrorResponse(w, err, http.StatusNotFound, handler.Logger)
httperror.WriteErrorResponse(w, ErrInvalidCredentials, http.StatusBadRequest, handler.Logger)
return
} else if err != nil {
httperror.WriteErrorResponse(w, err, http.StatusInternalServerError, handler.Logger)