| @@ -19,7 +19,9 @@ class ArchivedUserSubscriber implements EventSubscriberInterface | |||||
| private readonly AccountUserRepository $accountUserRepo, | private readonly AccountUserRepository $accountUserRepo, | ||||
| private readonly TenantContext $tenantContext, | private readonly TenantContext $tenantContext, | ||||
| private readonly RouterInterface $router, | private readonly RouterInterface $router, | ||||
| ) {} | |||||
| ) | |||||
| { | |||||
| } | |||||
| public function onKernelRequest(RequestEvent $event): void | public function onKernelRequest(RequestEvent $event): void | ||||
| { | { | ||||
| @@ -28,7 +30,7 @@ class ArchivedUserSubscriber implements EventSubscriberInterface | |||||
| } | } | ||||
| $token = $this->tokenStorage->getToken(); | $token = $this->tokenStorage->getToken(); | ||||
| $user = $token?->getUser(); | |||||
| $user = $token?->getUser(); | |||||
| if ($user === null) { | if ($user === null) { | ||||
| return; | return; | ||||
| @@ -41,7 +43,7 @@ class ArchivedUserSubscriber implements EventSubscriberInterface | |||||
| $accountUser = $this->accountUserRepo->findOneBy([ | $accountUser = $this->accountUserRepo->findOneBy([ | ||||
| 'account' => $account, | 'account' => $account, | ||||
| 'user' => $user, | |||||
| 'user' => $user, | |||||
| ]); | ]); | ||||
| if ($accountUser === null || !$accountUser->isArchived()) { | if ($accountUser === null || !$accountUser->isArchived()) { | ||||
| @@ -13,11 +13,13 @@ use Symfony\Component\Routing\RouterInterface; | |||||
| class TenantRequestSubscriber implements EventSubscriberInterface | class TenantRequestSubscriber implements EventSubscriberInterface | ||||
| { | { | ||||
| public function __construct( | 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 | public function onKernelRequest(RequestEvent $event): void | ||||
| { | { | ||||
| @@ -34,7 +36,7 @@ class TenantRequestSubscriber implements EventSubscriberInterface | |||||
| return; | return; | ||||
| } | } | ||||
| $slug = str_replace('.' . $appDomainHost, '', $host); | |||||
| $slug = str_replace('.' . $appDomainHost, '', $host); | |||||
| $account = $this->accountRepo->findBySlug($slug); | $account = $this->accountRepo->findBySlug($slug); | ||||
| if ($account === null) { | if ($account === null) { | ||||
| @@ -13,7 +13,9 @@ class AccessDeniedHandler implements AccessDeniedHandlerInterface | |||||
| { | { | ||||
| public function __construct( | public function __construct( | ||||
| private readonly UrlGeneratorInterface $urlGenerator, | private readonly UrlGeneratorInterface $urlGenerator, | ||||
| ) {} | |||||
| ) | |||||
| { | |||||
| } | |||||
| public function handle(Request $request, AccessDeniedException $exception): Response | public function handle(Request $request, AccessDeniedException $exception): Response | ||||
| { | { | ||||
| @@ -13,9 +13,13 @@ class ArchivedUserChecker implements UserCheckerInterface | |||||
| public function __construct( | public function __construct( | ||||
| private readonly AccountUserRepository $accountUserRepo, | private readonly AccountUserRepository $accountUserRepo, | ||||
| private readonly TenantContext $tenantContext, | private readonly TenantContext $tenantContext, | ||||
| ) {} | |||||
| ) | |||||
| { | |||||
| } | |||||
| public function checkPreAuth(UserInterface $user): void {} | |||||
| public function checkPreAuth(UserInterface $user): void | |||||
| { | |||||
| } | |||||
| public function checkPostAuth(UserInterface $user): void | public function checkPostAuth(UserInterface $user): void | ||||
| { | { | ||||
| @@ -26,7 +30,7 @@ class ArchivedUserChecker implements UserCheckerInterface | |||||
| $accountUser = $this->accountUserRepo->findOneBy([ | $accountUser = $this->accountUserRepo->findOneBy([ | ||||
| 'account' => $account, | 'account' => $account, | ||||
| 'user' => $user, | |||||
| 'user' => $user, | |||||
| ]); | ]); | ||||
| if ($accountUser !== null && $accountUser->isArchived()) { | if ($accountUser !== null && $accountUser->isArchived()) { | ||||