feat: use username instead of uid (#1977)

* #1916 replace userId to username

* resolve

---------

Co-authored-by: Александр Тумайкин <AATumaykin@tsum.ru>
This commit is contained in:
Alexandr Tumaykin
2023-07-20 14:48:39 +03:00
committed by GitHub
parent 336b32004d
commit f91f09adea
24 changed files with 189 additions and 109 deletions

View File

@ -46,6 +46,7 @@ func (s *APIV1Service) registerSystemRoutes(g *echo.Group) {
g.GET("/status", func(c echo.Context) error {
ctx := c.Request().Context()
systemStatus := SystemStatus{
Profile: *s.Profile,
DBSize: 0,
@ -76,7 +77,7 @@ func (s *APIV1Service) registerSystemRoutes(g *echo.Group) {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find host user").SetInternal(err)
}
if hostUser != nil {
systemStatus.Host = convertUserFromStore(hostUser)
systemStatus.Host = &User{ID: hostUser.ID}
// data desensitize
systemStatus.Host.OpenID = ""
systemStatus.Host.Email = ""