Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: auth api json format (#2021)

Mason Suna9eb605b0f3b
diff --git a/api/v1/auth.go b/api/v1/auth.go
index c42e5ab84..7d2b279c2 100644
--- a/api/v1/auth.go
+++ b/api/v1/auth.go
@@ -65,7 +65,8 @@ func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
if err := s.createAuthSignInActivity(c, user); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err)
}
- return c.JSON(http.StatusOK, user)
+ userMessage := convertUserFromStore(user)
+ return c.JSON(http.StatusOK, userMessage)
})
// POST /auth/signin/sso - Sign in with SSO
@@ -152,7 +153,8 @@ func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
if err := s.createAuthSignInActivity(c, user); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err)
}
- return c.JSON(http.StatusOK, user)
+ userMessage := convertUserFromStore(user)
+ return c.JSON(http.StatusOK, userMessage)
})
// POST /auth/signup - Sign up a new user.
@@ -218,7 +220,8 @@ func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err)
}
- return c.JSON(http.StatusOK, user)
+ userMessage := convertUserFromStore(user)
+ return c.JSON(http.StatusOK, userMessage)
})
// POST /auth/signout - Sign out.