8000 minor #7326 [Security] Warn for implementing `eraseCredentials` (rvan… · symfony/symfony-docs@ef31047 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef31047

Browse files
committed
minor #7326 [Security] Warn for implementing eraseCredentials (rvanlaak, javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- [Security] Warn for implementing `eraseCredentials` ... as implementing `eraseCredentials` on a Doctrine entity will be flushed. Setting `password` to `null` will actually be saved at every login attempt. This might also could be a warning with the `UserInterface` docblock directly (?) Commits ------- 50305ff Update caution about eraseCredentials 1eed188 Minor reword bee0cba Warn for implementing `eraseCredentials`
2 parents 8109074 + 50305ff commit ef31047

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

security/entity_provider.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ forces the class to have the five following methods:
169169

170170
To learn more about each of these, see :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface`.
171171

172+
.. caution::
173+
174+
The ``eraseCredentials()`` method is only meant to clean up possibly stored
175+
plain text passwords (or similar credentials). Be careful what to erase
176+
if your user class is also mapped to a database as the modified object
177+
will likely be persisted during the request.
178+
172179
What do the serialize and unserialize Methods do?
173180
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174181

0 commit comments

Comments
 (0)
0