diff --git a/authentik/root/settings.py b/authentik/root/settings.py index 8197138f7..6bcaeb159 100644 --- a/authentik/root/settings.py +++ b/authentik/root/settings.py @@ -108,22 +108,22 @@ INSTALLED_APPS = [ "authentik.sources.ldap.apps.AuthentikSourceLDAPConfig", "authentik.sources.oauth.apps.AuthentikSourceOAuthConfig", "authentik.sources.saml.apps.AuthentikSourceSAMLConfig", - "authentik.stages.captcha.apps.AuthentikStageCaptchaConfig", - "authentik.stages.consent.apps.AuthentikStageConsentConfig", - "authentik.stages.dummy.apps.AuthentikStageDummyConfig", - "authentik.stages.email.apps.AuthentikStageEmailConfig", - "authentik.stages.prompt.apps.AuthentikStagPromptConfig", - "authentik.stages.identification.apps.AuthentikStageIdentificationConfig", - "authentik.stages.invitation.apps.AuthentikStageUserInvitationConfig", - "authentik.stages.user_delete.apps.AuthentikStageUserDeleteConfig", - "authentik.stages.user_login.apps.AuthentikStageUserLoginConfig", - "authentik.stages.user_logout.apps.AuthentikStageUserLogoutConfig", - "authentik.stages.user_write.apps.AuthentikStageUserWriteConfig", "authentik.stages.authenticator_static.apps.AuthentikStageAuthenticatorStaticConfig", "authentik.stages.authenticator_totp.apps.AuthentikStageAuthenticatorTOTPConfig", "authentik.stages.authenticator_validate.apps.AuthentikStageAuthenticatorValidateConfig", "authentik.stages.authenticator_webauthn.apps.AuthentikStageAuthenticatorWebAuthnConfig", + "authentik.stages.captcha.apps.AuthentikStageCaptchaConfig", + "authentik.stages.consent.apps.AuthentikStageConsentConfig", + "authentik.stages.dummy.apps.AuthentikStageDummyConfig", + "authentik.stages.email.apps.AuthentikStageEmailConfig", + "authentik.stages.identification.apps.AuthentikStageIdentificationConfig", + "authentik.stages.invitation.apps.AuthentikStageUserInvitationConfig", "authentik.stages.password.apps.AuthentikStagePasswordConfig", + "authentik.stages.prompt.apps.AuthentikStagePromptConfig", + "authentik.stages.user_delete.apps.AuthentikStageUserDeleteConfig", + "authentik.stages.user_login.apps.AuthentikStageUserLoginConfig", + "authentik.stages.user_logout.apps.AuthentikStageUserLogoutConfig", + "authentik.stages.user_write.apps.AuthentikStageUserWriteConfig", "rest_framework", "django_filters", "drf_yasg2", diff --git a/authentik/stages/password/stage.py b/authentik/stages/password/stage.py index 7995e6cb6..e69d3e6b4 100644 --- a/authentik/stages/password/stage.py +++ b/authentik/stages/password/stage.py @@ -18,8 +18,8 @@ from authentik.flows.challenge import Challenge, ChallengeResponse, ChallengeTyp from authentik.flows.models import Flow, FlowDesignation from authentik.flows.planner import PLAN_CONTEXT_PENDING_USER from authentik.flows.stage import ChallengeStageView -from authentik.lib.utils.reflection import path_to_class from authentik.lib.templatetags.authentik_utils import avatar +from authentik.lib.utils.reflection import path_to_class from authentik.stages.password.models import PasswordStage LOGGER = get_logger() @@ -68,6 +68,7 @@ class PasswordChallengeResponse(ChallengeResponse): password = CharField() + class PasswordStageView(ChallengeStageView): """Authentication stage which authenticates against django's AuthBackend""" @@ -136,7 +137,9 @@ class PasswordStageView(ChallengeStageView): LOGGER.debug("Invalid credentials") # Manually inject error into form response._errors.setdefault("password", []) - response._errors["password"].append(ErrorDetail(_("Invalid password"), "invalid")) + response._errors["password"].append( + ErrorDetail(_("Invalid password"), "invalid") + ) return self.challenge_invalid(response) # User instance returned from authenticate() has .backend property set self.executor.plan.context[PLAN_CONTEXT_PENDING_USER] = user diff --git a/authentik/stages/prompt/apps.py b/authentik/stages/prompt/apps.py index 9280f6ac5..c584b2968 100644 --- a/authentik/stages/prompt/apps.py +++ b/authentik/stages/prompt/apps.py @@ -2,7 +2,7 @@ from django.apps import AppConfig -class AuthentikStagPromptConfig(AppConfig): +class AuthentikStagePromptConfig(AppConfig): """authentik prompt stage config""" name = "authentik.stages.prompt"