Exemple #1
0
def forgot_password():
    form = __forgot_passwd_form()
    if request.method == "GET":
        return render_template("forgot_password.html", **{
            "form": generate_form(form, **{
                "action": "/user/forgot-password/",
                "method": "post",
            })
        })

    elif request.method == "POST":
        form_values = get_form_values(request, __forgot_passwd_form())
        user_obj = users.get_user_by_attr({"email": form_values["email"]})
        users.send_reset_passwd_notice(user_obj)
        return "Check your email"
Exemple #2
0
def _post_forgot_password():
    form = _forgot_passwd_form()
    form_values = get_form_values(request, form)
    user_obj = users.get_user_by_attr({"email": form_values["email"]})
    users.send_reset_passwd_notice(user_obj)
    return render_template("forgot_password_done.html")