"Feature: Update guest request template design"

This commit is contained in:
2025-05-29 11:41:21 +02:00
parent cd867c07f9
commit fb0e00f2a0
2 changed files with 68 additions and 12 deletions

View File

@@ -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):