Skip to content
Open
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion src/Document/UserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function updatePassword(UserInterface $user): void
$password = $this->userPasswordHasher->hashPassword($user, $plainPassword);

$user->setPassword($password);
$user->eraseCredentials();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm but we still support Symfony 6.4 where eraseCredentials is not deprecated? 🤔 So I think completely removing the calls might break stuff for some people

}

public function findUserByUsername(string $username): ?UserInterface
Expand Down
1 change: 0 additions & 1 deletion src/Entity/UserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function updatePassword(UserInterface $user): void
$password = $this->userPasswordHasher->hashPassword($user, $plainPassword);

$user->setPassword($password);
$user->eraseCredentials();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

}

public function findUserByUsername(string $username): ?UserInterface
Expand Down
5 changes: 4 additions & 1 deletion src/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public function __toString(): string
*/
public function __serialize(): array
{
$this->plainPassword = null;

return [
$this->password,
$this->salt,
Expand Down Expand Up @@ -106,9 +108,9 @@ public function addRole(string $role): void
}
}

#[\Deprecated]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it should be up to the users of this bundle to override the method on their user entity and add this attribute on their end? I feel like we cannot say if people are relying on this method to be called or not.

From what I understand Symfony will stop calling the method in case there is #[\Deprecated] present on the method.

Maybe we should do the same inside the UserManager classes? 🤔

public function eraseCredentials(): void
{
$this->plainPassword = null;
}

public function getId()
Expand Down Expand Up @@ -252,6 +254,7 @@ public function setEnabled(bool $enabled): void
public function setPassword(?string $password): void
{
$this->password = $password;
$this->plainPassword = null;
}

public function setSuperAdmin(bool $boolean): void
Expand Down