diff --git a/http/http.go b/http/http.go index edad182..d7485da 100644 --- a/http/http.go +++ b/http/http.go @@ -122,18 +122,18 @@ func (h *Handler) loginPost(c *gin.Context) { user, err := h.UserService.UserByUsername(username) if err != nil { - c.AbortWithStatus(http.StatusUnauthorized) + c.AbortWithError(http.StatusUnauthorized, err) return } if err = h.CredentialsVerifier.Verify(password, user.Password); err != nil { - c.AbortWithStatus(http.StatusUnauthorized) + c.AbortWithError(http.StatusUnauthorized, err) return } t, err := h.TokenVerifier.CreateToken(user) if err != nil { - c.AbortWithStatus(http.StatusUnauthorized) + c.AbortWithError(http.StatusUnauthorized, err) } maxAge := (int)((expiration * time.Hour).Seconds())