root: fix typo
This commit is contained in:
parent
c1e6786ea1
commit
a8681ac88f
|
@ -108,22 +108,22 @@ INSTALLED_APPS = [
|
||||||
"authentik.sources.ldap.apps.AuthentikSourceLDAPConfig",
|
"authentik.sources.ldap.apps.AuthentikSourceLDAPConfig",
|
||||||
"authentik.sources.oauth.apps.AuthentikSourceOAuthConfig",
|
"authentik.sources.oauth.apps.AuthentikSourceOAuthConfig",
|
||||||
"authentik.sources.saml.apps.AuthentikSourceSAMLConfig",
|
"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_static.apps.AuthentikStageAuthenticatorStaticConfig",
|
||||||
"authentik.stages.authenticator_totp.apps.AuthentikStageAuthenticatorTOTPConfig",
|
"authentik.stages.authenticator_totp.apps.AuthentikStageAuthenticatorTOTPConfig",
|
||||||
"authentik.stages.authenticator_validate.apps.AuthentikStageAuthenticatorValidateConfig",
|
"authentik.stages.authenticator_validate.apps.AuthentikStageAuthenticatorValidateConfig",
|
||||||
"authentik.stages.authenticator_webauthn.apps.AuthentikStageAuthenticatorWebAuthnConfig",
|
"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.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",
|
"rest_framework",
|
||||||
"django_filters",
|
"django_filters",
|
||||||
"drf_yasg2",
|
"drf_yasg2",
|
||||||
|
|
|
@ -18,8 +18,8 @@ from authentik.flows.challenge import Challenge, ChallengeResponse, ChallengeTyp
|
||||||
from authentik.flows.models import Flow, FlowDesignation
|
from authentik.flows.models import Flow, FlowDesignation
|
||||||
from authentik.flows.planner import PLAN_CONTEXT_PENDING_USER
|
from authentik.flows.planner import PLAN_CONTEXT_PENDING_USER
|
||||||
from authentik.flows.stage import ChallengeStageView
|
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.templatetags.authentik_utils import avatar
|
||||||
|
from authentik.lib.utils.reflection import path_to_class
|
||||||
from authentik.stages.password.models import PasswordStage
|
from authentik.stages.password.models import PasswordStage
|
||||||
|
|
||||||
LOGGER = get_logger()
|
LOGGER = get_logger()
|
||||||
|
@ -68,6 +68,7 @@ class PasswordChallengeResponse(ChallengeResponse):
|
||||||
|
|
||||||
password = CharField()
|
password = CharField()
|
||||||
|
|
||||||
|
|
||||||
class PasswordStageView(ChallengeStageView):
|
class PasswordStageView(ChallengeStageView):
|
||||||
"""Authentication stage which authenticates against django's AuthBackend"""
|
"""Authentication stage which authenticates against django's AuthBackend"""
|
||||||
|
|
||||||
|
@ -136,7 +137,9 @@ class PasswordStageView(ChallengeStageView):
|
||||||
LOGGER.debug("Invalid credentials")
|
LOGGER.debug("Invalid credentials")
|
||||||
# Manually inject error into form
|
# Manually inject error into form
|
||||||
response._errors.setdefault("password", [])
|
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)
|
return self.challenge_invalid(response)
|
||||||
# User instance returned from authenticate() has .backend property set
|
# User instance returned from authenticate() has .backend property set
|
||||||
self.executor.plan.context[PLAN_CONTEXT_PENDING_USER] = user
|
self.executor.plan.context[PLAN_CONTEXT_PENDING_USER] = user
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class AuthentikStagPromptConfig(AppConfig):
|
class AuthentikStagePromptConfig(AppConfig):
|
||||||
"""authentik prompt stage config"""
|
"""authentik prompt stage config"""
|
||||||
|
|
||||||
name = "authentik.stages.prompt"
|
name = "authentik.stages.prompt"
|
||||||
|
|
Reference in a new issue