Skip to content

Commit 940c631

Browse files
committed
use GetResponseUserEvent on registration init
1 parent e060f8c commit 940c631

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Controller/RegistrationController.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ public function registerAction(Request $request)
4343
$user = $userManager->createUser();
4444
$user->setEnabled(true);
4545

46-
$dispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, new UserEvent($user, $request));
46+
$event = new GetResponseUserEvent($user, $request);
47+
$dispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event);
48+
49+
if (null !== $event->getResponse()) {
50+
return $event->getResponse();
51+
}
4752

4853
$form = $formFactory->createForm();
4954
$form->setData($user);

0 commit comments

Comments
 (0)