Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the salt from the user entity #1514

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}