Skip to content

Commit

Permalink
Update RegisterController to use LegacyEventDispatcherProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
darookee authored May 4, 2020
1 parent f6ce25d commit 47e50bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Controller/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,7 +34,7 @@ public function __construct(
) {
$this->u2fAuthenticator = $u2fAuthenticator;
$this->session = $session;
$this->eventDispatcher = $eventDispatcher;
$this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher);
$this->registerTemplate = $registerTemplate;
}

Expand All @@ -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();
}
Expand Down

0 comments on commit 47e50bf

Please sign in to comment.