diff --git a/controllers/auth.ctrl.go b/controllers/auth.ctrl.go index 5720e7a..c0150af 100644 --- a/controllers/auth.ctrl.go +++ b/controllers/auth.ctrl.go @@ -52,7 +52,9 @@ func (AuthController) Auth(c echo.Context) error { } if bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(body.Password)) != nil { return c.JSON(http.StatusNotFound, echo.Map{ - "message": "invalid username or password", + "error": true, + "code": 1, + "message": "bad auth", }) } } @@ -86,14 +88,6 @@ func (AuthController) Auth(c echo.Context) error { return err } - if _, err := db.NewInsert().Model(&user).Exec(context.TODO()); err != nil { - return c.JSON(http.StatusInternalServerError, echo.Map{ - "error": true, - "code": 6, - "message": "Something went wrong. Please try again later", - }) - } - return c.JSON(http.StatusOK, echo.Map{ "refresh_token": refreshToken, "access_token": accessToken,