diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php index 4cb0515..4b35e3e 100644 --- a/src/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -44,7 +44,7 @@ class RegistrationController extends AbstractController name: 'user_register', defaults: [ '_api_resource_class' => User::class, - '_api_operation_name' => 'register', + '_api_operation_name' => 'user_register', ], methods: ['POST'] )] @@ -75,9 +75,6 @@ class RegistrationController extends AbstractController ) ); - $this->em->persist($user); - $this->em->flush(); - if (false === (bool) $this->getParameter('registration_verify_email')) { $user->setVerified(true); } else { @@ -97,6 +94,9 @@ class RegistrationController extends AbstractController ]); } + $this->em->persist($user); + $this->em->flush(); + $this->logger->info('A new user has registered ({username}).', [ 'username' => $user->getUserIdentifier(), ]);