From 287e1d66cb91d9b9c51be980432ccda0b72642af Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 28 Sep 2023 18:13:18 +0200 Subject: [PATCH] fix #1: add UniqueEntity constraint in the User entity --- src/Entity/User.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Entity/User.php b/src/Entity/User.php index c0e5138..6070e7b 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -9,9 +9,11 @@ use Doctrine\ORM\Mapping as ORM; use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface; use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\UserInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; #[ORM\Entity(repositoryClass: UserRepository::class)] #[ORM\HasLifecycleCallbacks] +#[UniqueEntity('email')] class User implements PasswordAuthenticatedUserInterface, UserInterface, TwoFactorInterface, EntityInterface { use Timestampable;