feat: secure CSRF cookie based on frontend URL protocol
This commit is contained in:
@@ -147,6 +147,8 @@ SESSION_COOKIE_SAMESITE = 'Lax'
|
|||||||
SESSION_COOKIE_NAME = 'sessionid'
|
SESSION_COOKIE_NAME = 'sessionid'
|
||||||
|
|
||||||
SESSION_COOKIE_SECURE = FRONTEND_URL.startswith('https')
|
SESSION_COOKIE_SECURE = FRONTEND_URL.startswith('https')
|
||||||
|
CSRF_COOKIE_SECURE = FRONTEND_URL.startswith('https')
|
||||||
|
|
||||||
|
|
||||||
hostname = urlparse(FRONTEND_URL).hostname
|
hostname = urlparse(FRONTEND_URL).hostname
|
||||||
is_ip_address = hostname.replace('.', '').isdigit()
|
is_ip_address = hostname.replace('.', '').isdigit()
|
||||||
|
|||||||
Reference in New Issue
Block a user