Bad request on auth controller bad req body

This commit is contained in:
Stefan Kostic
2022-03-04 15:25:12 +01:00
parent 7c28270c6a
commit 6266156fda

View File

@@ -35,7 +35,8 @@ func (controller *AuthController) Auth(c echo.Context) error {
var body AuthRequestBody
if err := c.Bind(&body); err != nil {
return err
c.Logger().Errorf("Failed to load auth user request body: %v", err)
return c.JSON(http.StatusBadRequest, responses.BadArgumentsError)
}
if err := c.Validate(&body); err != nil {
return c.JSON(http.StatusBadRequest, responses.BadArgumentsError)