fix #1: add UniqueEntity constraint in the User entity

This commit is contained in:
Simon Vieille 2023-09-28 18:13:18 +02:00
parent b23a4fe9c5
commit 287e1d66cb
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -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;