mirror of
https://github.com/usememos/memos.git
synced 2025-03-04 01:04:38 +08:00
fix: data desensitize
This commit is contained in:
parent
91d45d6d46
commit
0505598509
1 changed files with 5 additions and 0 deletions
|
@ -64,6 +64,11 @@ func (s *Server) registerUserRoutes(g *echo.Group) {
|
|||
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to fetch user").SetInternal(err)
|
||||
}
|
||||
|
||||
if user != nil {
|
||||
// data desensitize
|
||||
user.OpenID = ""
|
||||
}
|
||||
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
|
||||
if err := json.NewEncoder(c.Response().Writer).Encode(composeResponse(user)); err != nil {
|
||||
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to encode user response").SetInternal(err)
|
||||
|
|
Loading…
Reference in a new issue