Skip to content

Commit

Permalink
Keep PlainPasswordTrait in User Entity
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed Sep 29, 2024
1 parent 34110af commit cb9936a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 8 additions & 2 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Entity;

use App\Repository\UserRepository;
use App\Traits\PlainPasswordTrait;
use Stringable;
use DateTime;
use App\Enum\Roles;
Expand Down Expand Up @@ -55,8 +56,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, Passwor
use DomainAwareTrait;
use LastLoginTimeTrait;
use PasswordVersionTrait;
use RecoverySecretBoxTrait;
use PlainPasswordTrait;
use PlainRecoveryTokenTrait;
use RecoverySecretBoxTrait;
use RecoveryStartTimeTrait;
use MailCryptTrait;
use MailCryptSecretBoxTrait;
Expand Down Expand Up @@ -141,7 +143,11 @@ public function getPasswordHasherName(): ?string
return null;
}

public function eraseCredentials()
public function eraseCredentials(): void
{
// If you store any temporary, sensitive data on the user, clear it here
$this->plainPassword = null;
$this->erasePlainMailCryptPrivateKey();
$this->erasePlainRecoveryToken();
}
}
8 changes: 0 additions & 8 deletions src/Traits/PlainPasswordTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,4 @@ public function setPlainPassword(?string $plainPassword): void
{
$this->plainPassword = $plainPassword;
}

public function eraseCredentials(): void
{
// If you store any temporary, sensitive data on the user, clear it here
$this->plainPassword = null;
$this->erasePlainMailCryptPrivateKey();
$this->erasePlainRecoveryToken();
}
}

0 comments on commit cb9936a

Please sign in to comment.