Private
Public Access
1
0

chg: usr: add forgot password functionality #4

This commit is contained in:
2026-04-12 08:10:36 +02:00
parent c0dcc2896a
commit e2b227ed7a
8 changed files with 512 additions and 69 deletions

View File

@@ -11,6 +11,8 @@
namespace App\Entity;
use App\Repository\UserRepository;
use DateTime;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -55,6 +57,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[Column(length: 64, nullable: true)]
private ?string $verificationToken = null;
#[Column(length: 64, nullable: true)]
private ?string $resetToken = null;
#[Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?DateTime $resetTokenExpiresAt = null;
public function getId(): ?int
{
@@ -137,4 +145,26 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$this->verificationToken = $verificationToken;
return $this;
}
public function getResetToken(): ?string
{
return $this->resetToken;
}
public function setResetToken(?string $resetToken): self
{
$this->resetToken = $resetToken;
return $this;
}
public function getResetTokenExpiresAt(): ?DateTime
{
return $this->resetTokenExpiresAt;
}
public function setResetTokenExpiresAt(?DateTime $resetTokenExpiresAt): self
{
$this->resetTokenExpiresAt = $resetTokenExpiresAt;
return $this;
}
}