From fb0e00f2a020712b795a1166a5a004d754b0d3bf Mon Sep 17 00:00:00 2001 From: Till Tomczak Date: Thu, 29 May 2025 11:41:21 +0200 Subject: [PATCH] "Feature: Update guest request template design" --- backend/app/app.py | 12 ----- backend/app/templates/guest_request.html | 68 ++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 12 deletions(-) diff --git a/backend/app/app.py b/backend/app/app.py index 846498e5e..964268de9 100644 --- a/backend/app/app.py +++ b/backend/app/app.py @@ -50,18 +50,6 @@ app.config["WTF_CSRF_ENABLED"] = True # CSRF-Schutz initialisieren csrf = CSRFProtect(app) -# CSRF-Exemption für Guest-API-Endpunkte -@app.before_request -def csrf_exempt_for_guest_api(): - """Befreit bestimmte API-Endpunkte vom CSRF-Schutz.""" - if request.endpoint and ( - request.endpoint.startswith('guest.api_') or - request.path.startswith('/api/guest/') or - request.path.startswith('/api/jobs/start/') - ): - # CSRF-Schutz für diese Endpunkte deaktivieren - csrf._exempt_views.add(request.endpoint) - # CSRF-Error-Handler @csrf.error_handler def csrf_error(reason): diff --git a/backend/app/templates/guest_request.html b/backend/app/templates/guest_request.html index 33ba307fc..94c6ea2de 100644 --- a/backend/app/templates/guest_request.html +++ b/backend/app/templates/guest_request.html @@ -191,4 +191,72 @@ + + {% endblock %} \ No newline at end of file