diff --git a/backend/internal/api/handler/user.go b/backend/internal/api/handler/user.go index fe82401..8f752ee 100644 --- a/backend/internal/api/handler/user.go +++ b/backend/internal/api/handler/user.go @@ -41,7 +41,7 @@ func (s Handler) UserLogin() func(http.ResponseWriter, *http.Request) { return } else { // if the user was found but there is an error, throw it also - h.ResultErrorJSON(w, r, http.StatusBadGateway, err.Error(), nil) + h.ResultErrorJSON(w, r, http.StatusUnauthorized, err.Error(), nil) return } } diff --git a/backend/internal/auth/auth.go b/backend/internal/auth/auth.go index 15cc905..719e93b 100644 --- a/backend/internal/auth/auth.go +++ b/backend/internal/auth/auth.go @@ -31,7 +31,7 @@ func PeformLogin(email, pass string) (GeneratedResponse, error) { // Compare stored PW and given PW err = bcrypt.CompareHashAndPassword([]byte(user.Secret), []byte(pass)) if err != nil { - return GeneratedResponse{}, errors.New("username or Password is wrong") + return GeneratedResponse{}, errors.New("username or password is wrong") } // Everything seems legit, generate JWT jwtData, err := Generate(&user)