Skip to content
This repository was archived by the owner on Jun 1, 2021. It is now read-only.

Commit b86fcab

Browse files
committed
fix: csrf requests with cookies
1 parent 4234259 commit b86fcab

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Django==3.0.4
1+
git+https://github.com/django/django.git@ffde4d5da88da6ed40ffc090503896d329bc67f8 # Until 3.1 is released because of SESSION_COOKIE_SAMESITE
22
djangorestframework==3.11.0
33
django-environ==0.4.5
44
twilio==6.37.0

shoppingline/settings.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,18 @@
126126
"rest_framework.renderers.JSONRenderer"
127127
]
128128

129-
CORS_ORIGIN_ALLOW_ALL = True
129+
CORS_ORIGIN_WHITELIST = [
130+
"https://helpingagents.de"
131+
]
132+
133+
CORS_ORIGIN_REGEX_WHITELIST = [
134+
r"^https://.*\.now\.sh$",
135+
]
136+
137+
138+
CORS_ALLOW_CREDENTIALS = True
139+
SESSION_COOKIE_SECURE = True
140+
SESSION_COOKIE_SAMESITE = "None"
130141

131142
TWILIO_ACCOUNT_SID = env("TWILIO_ACCOUNT_SID")
132143
TWILIO_AUTH_TOKEN = env("TWILIO_AUTH_TOKEN")

0 commit comments

Comments
 (0)