code: public function getContext(): string
      {
          $tenant = $this->parameterService->get('ds_tenant.tenant.default');
          $request = $this->requestStack->getCurrentRequest();
  
          if ($request->request->has('tenant') && $request->request->get('tenant')) {
              $tenant = $request->request->get('tenant');
          }
  
          if ($request->query->has('tenant') && $request->query->get('tenant')) {
              $tenant = $request->query->get('tenant');
          }
  
          $token = $this->tokenStorage->getToken();
  
          if ($token) {
              $user = $token->getUser();
  
              if ($user instanceof User) {
                  $tenant = $user->getTenant();
              }
          }
  
          return $tenant;
      }
docs: Get the contextual tenant
  
  @return string