feat: secure CSRF cookie based on frontend URL protocol

This commit is contained in:
Sean Morley
2025-05-31 17:30:33 -04:00
parent e89f2a947e
commit 806efd71bf

View File

@@ -147,6 +147,8 @@ SESSION_COOKIE_SAMESITE = 'Lax'
SESSION_COOKIE_NAME = 'sessionid'
SESSION_COOKIE_SECURE = FRONTEND_URL.startswith('https')
CSRF_COOKIE_SECURE = FRONTEND_URL.startswith('https')
hostname = urlparse(FRONTEND_URL).hostname
is_ip_address = hostname.replace('.', '').isdigit()