diff --git a/pkg/server/api/console/v1/resolver.go b/pkg/server/api/console/v1/resolver.go index f00875f81..5fc5c676a 100644 --- a/pkg/server/api/console/v1/resolver.go +++ b/pkg/server/api/console/v1/resolver.go @@ -196,6 +196,10 @@ func graphqlHandler(proboSvc *probo.Service, usrmgrSvc *usrmgr.Service, authCfg func (r *Resolver) GetTenantServiceIfAuthorized(ctx context.Context, tenantID gid.TenantID) *probo.TenantService { tenantIDs, _ := ctx.Value(userTenantContextKey).(*[]gid.TenantID) + if tenantIDs == nil { + panic(fmt.Errorf("tenant not found")) + } + for _, id := range *tenantIDs { if id == tenantID { return r.proboSvc.WithTenant(tenantID)