From cc2602cb7789c7b4016a773209b57c6dc9aff285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Wed, 24 Sep 2025 23:10:47 +0200 Subject: [PATCH] fix: user registration endpoint --- src/Controller/RegistrationController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(), ]);