fix(api): disable csrf checks for api routes
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 20s
CI/CD Pipeline / Build and Push Images (push) Successful in 6s
CI/CD Pipeline / Internal Notify (push) Successful in 1s
CI/CD Pipeline / Deploy Dev in Dokploy (push) Successful in 1s

This commit is contained in:
2026-04-29 12:09:56 +02:00
parent be7af18c36
commit 90856d5a7e
4 changed files with 34 additions and 6 deletions

View File

@@ -167,7 +167,7 @@ MIDDLEWARE = [
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"apps.core.middleware.ApiCsrfExemptMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",

View File

@@ -29,11 +29,6 @@ CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_PRIVATE_NETWORK = True
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
MIDDLEWARE = [
middleware
for middleware in MIDDLEWARE
if middleware != "django.middleware.csrf.CsrfViewMiddleware"
]
def _normalize_local_host(host: str) -> str: