Skip to content

Commit

Permalink
events: associate login_failed events to a user if possible (goauthen…
Browse files Browse the repository at this point in the history
…tik#10270)

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
  • Loading branch information
rissson authored Jun 27, 2024
1 parent cb4bc5b commit 8adbba6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion authentik/events/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def on_login_failed(
**kwargs,
):
"""Failed Login, authentik custom event"""
Event.new(EventAction.LOGIN_FAILED, **credentials, stage=stage, **kwargs).from_http(request)
user = User.objects.filter(username=credentials.get("username")).first()
Event.new(EventAction.LOGIN_FAILED, **credentials, stage=stage, **kwargs).from_http(request, user)


@receiver(invitation_used)
Expand Down

0 comments on commit 8adbba6

Please sign in to comment.