From d74aca91c689b54b7b49bbfa7121f458f4caf751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalevi=20Yyp=C3=A4naho?= Date: Mon, 27 Nov 2023 20:35:57 +0200 Subject: Adding csrf to templates. --- routes/create.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'routes/create.py') diff --git a/routes/create.py b/routes/create.py index 083cc0e..2de8e27 100644 --- a/routes/create.py +++ b/routes/create.py @@ -41,7 +41,8 @@ def create(): @app.route("/set/quiz",methods=["POST"]) def new_quiz(): - csrf_check("/#create") + if csrf_check(): + return redirect("/#create") if not "id" in session.keys(): session["alert"]="Tarvitset nimimerkin loudaksesi." return redirect("/#create") @@ -52,7 +53,8 @@ def new_quiz(): @app.route("/set/quiz_ready",methods=["POST"]) def quiz_ready(): - csrf_check("/#create") + if csrf_check(): + return redirect("/#create") if "quiz_id" not in session.keys(): session["alert"] = "Kyselmä jota ei ole aloitettu ei voi olla valmis." return redirect("/#create") -- cgit v1.2.3