8000 Update caution about eraseCredentials · symfony/symfony-docs@50305ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 50305ff

Browse files
authored
Update caution about eraseCredentials
1 parent 1eed188 commit 50305ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

security/entity_provider.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ To learn more about each of these, see :class:`Symfony\\Component\\Security\\Cor
171171

172172
.. caution::
173173

174-
Do not actually implement ``eraseCredentials()`` when loading the users
175-
directly from Doctrine, as changes will be flushed when a user tries to
176-
login. For example, setting ``password`` to ``null`` will be flushed with
177-
every login attempt.
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.
178178

179179
What do the serialize and unserialize Methods do?
180180
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)
0