Skip to content

Commit

Permalink
Remove the salt from the user entity
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Apr 15, 2024
1 parent 12f7357 commit a0caccd
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 a0caccd

Please sign in to comment.