Skip to content

Commit 990af9a

Browse files
committed
🔧[#45] add session and CSRF samesite option
1 parent 44eb847 commit 990af9a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

open_api_framework/conf/base.py

+8
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,16 @@
416416
#
417417
SESSION_COOKIE_SECURE = IS_HTTPS
418418
SESSION_COOKIE_HTTPONLY = True
419+
# set same-site attribute to None to allow emdedding the SDK for making cross domain
420+
# requests.
421+
SESSION_COOKIE_SAMESITE = config(
422+
"SESSION_COOKIE_SAMESITE", default="None" if IS_HTTPS else "Lax"
423+
)
419424

420425
CSRF_COOKIE_SECURE = IS_HTTPS
426+
CSRF_COOKIE_SAMESITE = config(
427+
"CSRF_COOKIE_SAMESITE", default="None" if IS_HTTPS else "Lax"
428+
)
421429

422430
X_FRAME_OPTIONS = "DENY"
423431

0 commit comments

Comments
 (0)