|
@@ -12,6 +12,7 @@ use App\ApiResources\HelloAsso\HelloAssoProfile;
|
|
|
use App\Entity\Access\Access;
|
|
use App\Entity\Access\Access;
|
|
|
use App\Entity\Organization\HelloAsso;
|
|
use App\Entity\Organization\HelloAsso;
|
|
|
use App\Service\HelloAsso\ConnectionService;
|
|
use App\Service\HelloAsso\ConnectionService;
|
|
|
|
|
+use App\Service\MercureHub;
|
|
|
use http\Client\Response;
|
|
use http\Client\Response;
|
|
|
use Symfony\Bundle\SecurityBundle\Security;
|
|
use Symfony\Bundle\SecurityBundle\Security;
|
|
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
|
@@ -24,6 +25,7 @@ class ConnectionRequestProcessor implements ProcessorInterface
|
|
|
public function __construct(
|
|
public function __construct(
|
|
|
private readonly ConnectionService $connectionService,
|
|
private readonly ConnectionService $connectionService,
|
|
|
private Security $security,
|
|
private Security $security,
|
|
|
|
|
+ private MercureHub $mercureHub,
|
|
|
) {
|
|
) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -52,11 +54,15 @@ class ConnectionRequestProcessor implements ProcessorInterface
|
|
|
throw new \RuntimeException('Forbidden');
|
|
throw new \RuntimeException('Forbidden');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $this->connectionService->connect(
|
|
|
|
|
|
|
+ $helloAssoEntity = $this->connectionService->connect(
|
|
|
$connectionRequest->getOrganizationId(),
|
|
$connectionRequest->getOrganizationId(),
|
|
|
$connectionRequest->getAuthorizationCode()
|
|
$connectionRequest->getAuthorizationCode()
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+ $helloAssoProfile = $this->connectionService->makeHelloAssoProfile($connectionRequest->getOrganizationId());
|
|
|
|
|
+
|
|
|
|
|
+ $this->mercureHub->publishUpdate($access->getId(), $helloAssoProfile);
|
|
|
|
|
+
|
|
|
return $connectionRequest;
|
|
return $connectionRequest;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|