chg: usr: add forgot password functionality #4
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user