-
-
Notifications
You must be signed in to change notification settings - Fork 475
User: deprecate eraseCredentials #1739
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
base: 5.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,6 @@ public function updatePassword(UserInterface $user): void | |
| $password = $this->userPasswordHasher->hashPassword($user, $plainPassword); | ||
|
|
||
| $user->setPassword($password); | ||
| $user->eraseCredentials(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| } | ||
|
|
||
| public function findUserByUsername(string $username): ?UserInterface | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,8 @@ public function __toString(): string | |
| */ | ||
| public function __serialize(): array | ||
| { | ||
| $this->plainPassword = null; | ||
|
|
||
| return [ | ||
| $this->password, | ||
| $this->salt, | ||
|
|
@@ -106,9 +108,9 @@ public function addRole(string $role): void | |
| } | ||
| } | ||
|
|
||
| #[\Deprecated] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Maybe we should do the same inside the |
||
| public function eraseCredentials(): void | ||
| { | ||
| $this->plainPassword = null; | ||
| } | ||
|
|
||
| public function getId() | ||
|
|
@@ -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 | ||
|
|
||
There was a problem hiding this comment.
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
eraseCredentialsis not deprecated? 🤔 So I think completely removing the calls might break stuff for some people