1
0
forked from baron/baron-sso

fix: revert tab name and improve group list error handling

This commit is contained in:
2026-03-04 15:21:31 +09:00
parent 71473b0f6c
commit 4392810ec7
3 changed files with 9 additions and 2 deletions

View File

@@ -192,12 +192,19 @@ func (s *userGroupService) List(ctx context.Context, tenantID string) ([]domain.
return nil, err
}
if s.ketoService == nil {
return groups, nil
}
// For each group, fetch member count from Keto
for i := range groups {
tuples, err := s.ketoService.ListRelations(ctx, "Tenant", groups[i].ID, "members", "")
if err == nil {
// Create dummy members just to carry the count for the JSON response
groups[i].Members = make([]domain.User, len(tuples))
} else {
slog.Warn("Failed to fetch member count from Keto", "groupID", groups[i].ID, "error", err)
groups[i].Members = []domain.User{}
}
}