Skip to content

Commit

Permalink
minor #1514 Remove the salt from the user entity (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was merged into the main branch.

Discussion
----------

Remove the salt from the user entity

This is not needed since a long time ago.

Commits
-------

a0caccd Remove the salt from the user entity
  • Loading branch information
javiereguiluz committed Apr 16, 2024
2 parents b02544a + a0caccd commit a53f930
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,6 @@ public function setRoles(array $roles): void
$this->roles = $roles;
}

/**
* Returns the salt that was originally used to encode the password.
*
* {@inheritdoc}
*/
public function getSalt(): ?string
{
// We're using bcrypt in security.yaml to encode the password, so
// the salt value is built-in and you don't have to generate one
// See https://en.wikipedia.org/wiki/Bcrypt

return null;
}

/**
* Removes sensitive data from the user.
*
Expand All @@ -168,7 +154,6 @@ 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];
}

Expand All @@ -177,7 +162,6 @@ public function __serialize(): array
*/
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;
}
}

0 comments on commit a53f930

Please sign in to comment.