"Feature: Update guest request template design"
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user