Skip to content

Commit

Permalink
Show blank page after passwort reset
Browse files Browse the repository at this point in the history
  • Loading branch information
UlrichB22 committed Jan 24, 2025
1 parent 3ffc383 commit 8c19546
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 30 deletions.
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 %}

0 comments on commit 8c19546

Please sign in to comment.