Skip to content

Commit b39e369

Browse files
committed
Small extra clarification that security.authentication.success is probably
*not* the event you're looking for
1 parent b22637c commit b39e369

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/security/authentication.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,12 @@ Authentication Success and Failure Events
286286
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287287

288288
When a provider authenticates the user, a ``security.authentication.success``
289-
event is dispatched. Likewise, when a provider attempts authentication but
290-
fails (i.e. throws an ``AuthenticationException``), a
291-
``security.authentication.failure`` event is dispatched. You could listen on
289+
event is dispatched. But beware - this event will fire, for example, on *every*
290+
request if you have session-based authentication. See ``security.interactive_login``
291+
below if you need to do something when a user *actually* logs in.
292+
293+
When a provider attempts authentication but fails (i.e. throws an ``AuthenticationException``),
294+
a ``security.authentication.failure`` event is dispatched. You could listen on
292295
the ``security.authentication.failure`` event, for example, in order to log
293296
failed login attempts.
294297

0 commit comments

Comments
 (0)