diff --git a/backend/web/login/login.py b/backend/web/login/login.py index c6bcd70792a3e983ec895e1340688f9bef109902..f97ecac35a871d07f1acb2ac578dae2968af21c2 100644 --- a/backend/web/login/login.py +++ b/backend/web/login/login.py @@ -75,7 +75,10 @@ def recovery(): flow = request.args.get("flow") if not flow: - return redirect(KRATOS_PUBLIC_URL + "self-service/recovery/browser") + email = request.args.get("email") + response = redirect(KRATOS_PUBLIC_URL + "self-service/recovery/browser") + response.set_cookie("recovery_preset_email", email) + return response return render_template("recover.html", api_url=KRATOS_PUBLIC_URL, dashboard_url=DASHBOARD_URL) diff --git a/backend/web/static/base.js b/backend/web/static/base.js index 510d0c234a116175c553675b2755b82103d0448f..9d80b3b11d86e0793562b9f6f8cad45e839cc45e 100644 --- a/backend/web/static/base.js +++ b/backend/web/static/base.js @@ -444,6 +444,11 @@ function getFormElement(node, context) { readonly = false; label = "Please provide your e-mail address. If it is registered, we will send a recovery link to that address."; + var email = Cookies.get("recovery_preset_email"); + if (email) { + value = email; + Cookies.set("recovery_preset_email", ""); + } } return getFormInput( "email",