From 5c62e0bd23cbc6cde5c01d1f0028a9b4930264a0 Mon Sep 17 00:00:00 2001 From: Thomas Rubini <74205383+ThomasRubini@users.noreply.github.com> Date: Mon, 27 Mar 2023 17:19:36 +0200 Subject: [PATCH] Show message when password is invalid --- truthinquiry/routes/routes_admin.py | 3 ++- truthinquiry/templates/admin/auth.html | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/truthinquiry/routes/routes_admin.py b/truthinquiry/routes/routes_admin.py index 8b831a7..a4d23b7 100644 --- a/truthinquiry/routes/routes_admin.py +++ b/truthinquiry/routes/routes_admin.py @@ -19,7 +19,8 @@ def index(): @routes_admin.route("/auth") def auth(): - return flask.render_template("admin/auth.html") + input_failed = bool(flask.request.values.get("failed")) + return flask.render_template("admin/auth.html", failed=input_failed) @routes_admin.route("/npc/") @require_admin(ui=True) diff --git a/truthinquiry/templates/admin/auth.html b/truthinquiry/templates/admin/auth.html index 122bfa8..66dd733 100644 --- a/truthinquiry/templates/admin/auth.html +++ b/truthinquiry/templates/admin/auth.html @@ -1,3 +1,7 @@ +{% if failed %} +

Invalid password !

+{% endif %} +

Password :