From cac27f59628d3d87675b89dac3b59c04ca7282de Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Sat, 8 Jan 2022 18:46:17 +0100 Subject: [PATCH] LNDHub response for /auth call --- routes/auth/auth.ctrl.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/routes/auth/auth.ctrl.go b/routes/auth/auth.ctrl.go index 8a890e7..afae430 100644 --- a/routes/auth/auth.ctrl.go +++ b/routes/auth/auth.ctrl.go @@ -27,7 +27,11 @@ func (AuthRouter) Auth(c echo.Context) error { } if err := c.Validate(&body); err != nil { - return err + return c.JSON(http.StatusBadRequest, echo.Map{ + "error": true, + "code": 8, + "message": "Bad arguments", + }) } if (body.Login == "" || body.Password == "") && body.RefreshToken == "" { @@ -78,6 +82,7 @@ func (AuthRouter) Auth(c echo.Context) error { } return c.JSON(http.StatusOK, echo.Map{ - "user": user, + "refresh_token": user.RefreshToken.String, + "access_token": user.AccessToken.String, }) }