From 2683ef23d538eb846d5d799798fa82cca70dc017 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 31 Oct 2021 13:57:19 +0100 Subject: [PATCH] feat: expose if a user is a local user through the /user endpoint --- pkg/routes/api/v1/user_show.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/routes/api/v1/user_show.go b/pkg/routes/api/v1/user_show.go index 86619f62..ad7ae08a 100644 --- a/pkg/routes/api/v1/user_show.go +++ b/pkg/routes/api/v1/user_show.go @@ -35,6 +35,7 @@ type userWithSettings struct { user.User Settings *UserSettings `json:"settings"` DeletionScheduledAt time.Time `json:"deletion_scheduled_at"` + IsLocalUser bool `json:"is_local_user"` } // UserShow gets all informations about the current user @@ -74,6 +75,7 @@ func UserShow(c echo.Context) error { WeekStart: u.WeekStart, }, DeletionScheduledAt: u.DeletionScheduledAt, + IsLocalUser: u.Issuer == user.IssuerLocal, } return c.JSON(http.StatusOK, us)