|
|
|
@@ -13,11 +13,13 @@ use Symfony\Component\Routing\RouterInterface; |
|
|
|
class TenantRequestSubscriber implements EventSubscriberInterface |
|
|
|
{ |
|
|
|
public function __construct( |
|
|
|
private readonly TenantContext $tenantContext, |
|
|
|
private readonly AccountRepository $accountRepo, |
|
|
|
private readonly RouterInterface $router, |
|
|
|
private readonly string $appDomain, |
|
|
|
) {} |
|
|
|
private readonly TenantContext $tenantContext, |
|
|
|
private readonly AccountRepository $accountRepo, |
|
|
|
private readonly RouterInterface $router, |
|
|
|
private readonly string $appDomain, |
|
|
|
) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public function onKernelRequest(RequestEvent $event): void |
|
|
|
{ |
|
|
|
@@ -34,7 +36,7 @@ class TenantRequestSubscriber implements EventSubscriberInterface |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
$slug = str_replace('.' . $appDomainHost, '', $host); |
|
|
|
$slug = str_replace('.' . $appDomainHost, '', $host); |
|
|
|
$account = $this->accountRepo->findBySlug($slug); |
|
|
|
|
|
|
|
if ($account === null) { |
|
|
|
|