From 9d44088c00868fdaacf76cd2696017a9780c2ad5 Mon Sep 17 00:00:00 2001 From: Valery Maslov Date: Wed, 24 Apr 2024 11:29:47 +0300 Subject: [PATCH] Remove the salt from the user entity --- src/Entity/User.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/Entity/User.php b/src/Entity/User.php index 4cecc604..46992e14 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -123,17 +123,6 @@ public function setRoles(array $roles): void $this->roles = $roles; } - /** - * Returns the salt that was originally used to encode the password. - */ - public function getSalt(): ?string - { - // See "Do you need to use a Salt?" at https://symfony.com/doc/current/cookbook/security/entity_provider.html - // we're using bcrypt in security.yml to encode the password, so - // the salt value is built-in and you don't have to generate one - return null; - } - /** * Removes sensitive data from the user. */ @@ -145,13 +134,11 @@ public function eraseCredentials(): void public function __serialize(): array { - // add $this->salt too if you don't use Bcrypt or Argon2i return [$this->id, $this->username, $this->password]; } public function __unserialize(array $data): void { - // add $this->salt too if you don't use Bcrypt or Argon2i [$this->id, $this->username, $this->password] = $data; }