From 47e50bf26220c9a119c70c2388539265065c8fba Mon Sep 17 00:00:00 2001 From: Nils Uliczka Date: Mon, 4 May 2020 12:57:13 +0200 Subject: [PATCH] Update `RegisterController` to use `LegacyEventDispatcherProxy` --- Controller/RegisterController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Controller/RegisterController.php b/Controller/RegisterController.php index 67ca4bb..2731517 100644 --- a/Controller/RegisterController.php +++ b/Controller/RegisterController.php @@ -7,6 +7,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -33,7 +34,7 @@ public function __construct( ) { $this->u2fAuthenticator = $u2fAuthenticator; $this->session = $session; - $this->eventDispatcher = $eventDispatcher; + $this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher); $this->registerTemplate = $registerTemplate; } @@ -45,7 +46,7 @@ public function u2fAction(Request $request): Response $registration = $this->u2fAuthenticator->doRegistration($registrationRequest[0], $registerData); $event = new RegisterEvent($registration, $this->getUser(), $request->get('keyName')); - $this->eventDispatcher->dispatch('r_u2f_two_factor.register', $event); + $this->eventDispatcher->dispatch($event, 'r_u2f_two_factor.register'); return $event->getResponse(); }