Skip to content
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
14 changes: 14 additions & 0 deletions symfony/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
{
return (string) $this->email;
}

/**
* @see UserInterface
*
* Required until Symfony 8.0, where eraseCredentials() will be removed from the interface.
* No-op since plainPassword is cleared manually in the password processor.
*/
public function eraseCredentials(): void
{
// Intentionally left blank
}
}
```

Expand Down Expand Up @@ -251,6 +262,9 @@ final readonly class UserPasswordHasher implements ProcessorInterface
);
$data->setPassword($hashedPassword);

// To avoid leaving sensitive data like the plain password in memory or logs, we manually clear it after hashing.
$data->setPlainPassword(null);

return $this->processor->process($data, $operation, $uriVariables, $context);
}
}
Expand Down