8000 Warn for implementing `eraseCredentials` · symfony/symfony-docs@bee0cba · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit bee0cba

Browse files
authored
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.
1 parent 2d1c269 commit bee0cba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

security/entity_provider.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ 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+
Do not actually implement ``eraseCredentials`` when you load your users directly
175+
from Doctrine, as changes will be flushed when a user tries to login. As example,
176+
setting ``password`` to ``null`` will be flushed with every login attempt.
177+
172178
What do the serialize and unserialize Methods do?
173179
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174180

0 commit comments

Comments
 (0)
0