root: fix typo

This commit is contained in:
Jens Langhammer 2021-02-21 00:16:21 +01:00
parent c1e6786ea1
commit a8681ac88f
3 changed files with 17 additions and 14 deletions

View file

@ -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",

View file

@ -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

View file

@ -2,7 +2,7 @@
from django.apps import AppConfig
class AuthentikStagPromptConfig(AppConfig):
class AuthentikStagePromptConfig(AppConfig):
"""authentik prompt stage config"""
name = "authentik.stages.prompt"