mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-18 20:39:36 +02:00
feat: secure CSRF cookie based on frontend URL protocol
This commit is contained in:
parent
e89f2a947e
commit
806efd71bf
1 changed files with 2 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue