diff --git a/authentik/stages/password/stage.py b/authentik/stages/password/stage.py index 19f39b46c..f9afbf6bb 100644 --- a/authentik/stages/password/stage.py +++ b/authentik/stages/password/stage.py @@ -84,10 +84,11 @@ class PasswordStageView(ChallengeStageView): ) recovery_flow = Flow.objects.filter(designation=FlowDesignation.RECOVERY) if recovery_flow.exists(): - challenge.initial_data["recovery_url"] = reverse( + recover_url = reverse( "authentik_flows:flow-executor-shell", kwargs={"flow_slug": recovery_flow.first().slug}, ) + challenge.initial_data["recovery_url"] = self.request.build_absolute_uri(recover_url) return challenge def challenge_invalid(self, response: PasswordChallengeResponse) -> HttpResponse: diff --git a/authentik/stages/password/templates/stages/password/flow-form.html b/authentik/stages/password/templates/stages/password/flow-form.html deleted file mode 100644 index 21ea7e476..000000000 --- a/authentik/stages/password/templates/stages/password/flow-form.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends 'login/form_with_user.html' %} - -{% load i18n %} -{% load authentik_utils %} - -{% block beneath_form %} -{% if recovery_flow %} -{% trans 'Forgot password?' %} -{% endif %} -{% endblock %} diff --git a/web/src/elements/stages/password/PasswordStage.ts b/web/src/elements/stages/password/PasswordStage.ts index 4fba2e00b..8b6045d72 100644 --- a/web/src/elements/stages/password/PasswordStage.ts +++ b/web/src/elements/stages/password/PasswordStage.ts @@ -56,6 +56,10 @@ export class PasswordStage extends BaseStage { required=""> + ${this.challenge.recovery_url ? + html` + ${gettext("Forgot password?")}` : ""} +