- Login fonctionnel
This commit is contained in:
@ -31,6 +31,10 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column(type: "json")]
|
||||
private array $roles = [];
|
||||
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@ -103,16 +107,26 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
public function getRoles(): array
|
||||
{
|
||||
// TODO: Implement getRoles() method.
|
||||
|
||||
$roles = $this->roles;
|
||||
|
||||
if (empty($roles)) {
|
||||
$roles[] = 'ROLE_USER';
|
||||
}
|
||||
|
||||
return $roles;
|
||||
|
||||
}
|
||||
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
// TODO: Implement eraseCredentials() method.
|
||||
|
||||
}
|
||||
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
// TODO: Implement getUserIdentifier() method.
|
||||
|
||||
return $this->email; // Ou $this->pseudo si tu préfères utiliser le pseudo
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user