events: fix incorrect EventAction being used
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
7bc63791c9
commit
f8ef2b666f
|
@ -65,7 +65,7 @@ def on_login_failed(
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
"""Failed Login, authentik custom event"""
|
"""Failed Login, authentik custom event"""
|
||||||
Event.new(EventAction.USER_WRITE, **credentials, stage=stage, **kwargs).from_http(request)
|
Event.new(EventAction.LOGIN_FAILED, **credentials, stage=stage, **kwargs).from_http(request)
|
||||||
|
|
||||||
|
|
||||||
@receiver(invitation_used)
|
@receiver(invitation_used)
|
||||||
|
|
|
@ -29,7 +29,6 @@ from authentik.providers.oauth2.apps import AuthentikProviderOAuth2Config
|
||||||
from authentik.providers.oauth2.constants import (
|
from authentik.providers.oauth2.constants import (
|
||||||
ACR_AUTHENTIK_DEFAULT,
|
ACR_AUTHENTIK_DEFAULT,
|
||||||
AMR_MFA,
|
AMR_MFA,
|
||||||
AMR_OTP,
|
|
||||||
AMR_PASSWORD,
|
AMR_PASSWORD,
|
||||||
AMR_WEBAUTHN,
|
AMR_WEBAUTHN,
|
||||||
)
|
)
|
||||||
|
@ -474,6 +473,7 @@ class RefreshToken(SerializerModel, ExpiringModel, BaseGrantModel):
|
||||||
token["uid"] = generate_key()
|
token["uid"] = generate_key()
|
||||||
return self.provider.encode(token)
|
return self.provider.encode(token)
|
||||||
|
|
||||||
|
# pylint: disable=too-many-locals
|
||||||
def create_id_token(self, user: User, request: HttpRequest) -> IDToken:
|
def create_id_token(self, user: User, request: HttpRequest) -> IDToken:
|
||||||
"""Creates the id_token.
|
"""Creates the id_token.
|
||||||
See: http://openid.net/specs/openid-connect-core-1_0.html#IDToken"""
|
See: http://openid.net/specs/openid-connect-core-1_0.html#IDToken"""
|
||||||
|
|
|
@ -156,7 +156,7 @@ class TestProviderLDAP(SeleniumTestCase):
|
||||||
Event.objects.filter(
|
Event.objects.filter(
|
||||||
action=EventAction.LOGIN_FAILED,
|
action=EventAction.LOGIN_FAILED,
|
||||||
user={"pk": anon.pk, "email": anon.email, "username": anon.username},
|
user={"pk": anon.pk, "email": anon.email, "username": anon.username},
|
||||||
)
|
).exists(),
|
||||||
)
|
)
|
||||||
|
|
||||||
@retry()
|
@retry()
|
||||||
|
|
Reference in a new issue