Add validation for email registration
This commit is contained in:
parent
4a6191e287
commit
bdc67942ea
@ -11,6 +11,7 @@ use Symfony\Bridge\Doctrine\Types\UuidType;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
|
||||
@ -23,6 +24,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, JsonSer
|
||||
private ?Uuid $id = null;
|
||||
|
||||
#[ORM\Column(length: 180)]
|
||||
#[Assert\Email(
|
||||
message: 'The email {{ value }} is not a valid email.',
|
||||
)]
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user