Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show blank page after password reset #1830

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 36 additions & 30 deletions src/moin/apps/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,41 +138,41 @@ def robots():
"""\
User-agent: *
Crawl-delay: 20
Disallow: /+convert/
Disallow: /+dom/
Disallow: /+download/
Disallow: /+modify/
Disallow: /+content/
Disallow: /+delete/
Disallow: /+admin/
Disallow: /+ajaxdelete/
Disallow: /+ajaxdestroy/
Disallow: /+ajaxmodify/
Disallow: /+ajaxsubitems/
Disallow: /+destroy/
Disallow: /+backrefs/
Disallow: /+bookmark
Disallow: /+content/
Disallow: /+convert/
Disallow: /+create/
Disallow: /+rename/
Disallow: /+revert/
Disallow: /+delete/
Disallow: /+destroy/
Disallow: /+diff/
Disallow: /+diffraw/
Disallow: /+dispatch/
Disallow: /+dom/
Disallow: /+download/
Disallow: /+forwardrefs/
Disallow: /+index/
Disallow: /+jfu-server/
Disallow: /+sitemap/
Disallow: /+similar_names/
Disallow: /+quicklink/
Disallow: /+subscribe/
Disallow: /+forwardrefs/
Disallow: /+backrefs/
Disallow: /+wanteds/
Disallow: /+orphans/
Disallow: /+register
Disallow: /+recoverpass
Disallow: /+usersettings
Disallow: /+login
Disallow: /+logout
Disallow: /+bookmark
Disallow: /+diff/
Disallow: /+diffraw/
Disallow: /+modify/
Disallow: /+orphans/
Disallow: /+quicklink/
Disallow: /+recoverpass
Disallow: /+register
Disallow: /+rename/
Disallow: /+revert/
Disallow: /+search
Disallow: /+dispatch/
Disallow: /+admin/
Disallow: /+similar_names/
Disallow: /+sitemap/
Disallow: /+subscribe/
Disallow: /+usersettings
Disallow: /+wanteds/
Allow: /
""",
mimetype="text/plain",
Expand All @@ -187,6 +187,14 @@ def global_views():
return render_template("all.html", title_name=_("Global Views"), fqname=CompositeName("all", NAME_EXACT, ""))


@frontend.route("/+blank")
def show_blank():
"""
Show a blank page, e.g. as a result of a password reset. Usually an additional flash message is also shown.
"""
return render_template("blank.html", title_name="MoinWiki")


class LookupForm(Form):
name = OptionalText.using(label="name")
name_exact = OptionalText.using(label="name_exact")
Expand Down Expand Up @@ -2068,7 +2076,7 @@ def register():
)
else:
flash(_("Account created, please log in now."), "info")
return redirect(url_for(".show_root"))
return redirect(url_for(".show_blank"))

return render_template(template, title_name=title_name, form=form)

Expand Down Expand Up @@ -2132,7 +2140,6 @@ class PasswordLostForm(Form):

@frontend.route("/+lostpass", methods=["GET", "POST"])
def lostpass():
# TODO use ?next=next_location check if target is in the wiki and not outside domain
title_name = _("Lost Password")

if not _using_moin_auth():
Expand All @@ -2156,7 +2163,7 @@ def lostpass():
if not is_ok:
flash(msg, "error")
flash(_("If this account exists, you will be notified."), "info")
return redirect(url_for(".show_root"))
return redirect(url_for(".show_blank"))
return render_template("lostpass.html", title_name=title_name, form=form)


Expand Down Expand Up @@ -2201,7 +2208,6 @@ class PasswordRecoveryForm(Form):

@frontend.route("/+recoverpass", methods=["GET", "POST"])
def recoverpass():
# TODO use ?next=next_location check if target is in the wiki and not outside domain
title_name = _("Recover Password")

if not _using_moin_auth():
Expand All @@ -2218,7 +2224,7 @@ def recoverpass():
flash(_("Your password has been changed, you can log in now."), "info")
else:
flash(_("Your token is invalid!"), "error")
return redirect(url_for(".show_root"))
return redirect(url_for(".show_blank"))
return render_template("recoverpass.html", title_name=title_name, form=form)


Expand Down
4 changes: 4 additions & 0 deletions src/moin/templates/blank.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% extends theme("layout.html") %}
{% block content %}
<h1>{{ title }}</h1>
{% endblock %}
Loading