diff options
author | Kalevi Yypänaho <kyypanah@local> | 2023-11-27 20:35:57 +0200 |
---|---|---|
committer | Kalevi Yypänaho <kyypanah@local> | 2023-11-27 20:35:57 +0200 |
commit | d74aca91c689b54b7b49bbfa7121f458f4caf751 (patch) | |
tree | b13f1ffc7d6f5c816ac16147cc9b8703a17c69c7 /routes/create.py | |
parent | d6c73dbde8a35905a8f29caf9b6d088043a5e78f (diff) |
Adding csrf to templates.
Diffstat (limited to 'routes/create.py')
-rw-r--r-- | routes/create.py | 6 |
1 files changed, 4 insertions, 2 deletions
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") |