Skip to content

Commit

Permalink
settings: allow CSRF token access in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnshrmn committed Apr 29, 2022
1 parent 74d1ed2 commit ff82661
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TWLight/settings/server.py
Expand Up @@ -16,6 +16,8 @@
# Let Django know that allowed hosts are trusted for CSRF.
# Needed to be added for /admin
CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
# Allow CSRF token access in JavaScript
CSRF_COOKIE_HTTPONLY = False

# Never debug on servers
DEBUG = False
Expand All @@ -24,7 +26,6 @@
# python manage.py check --deploy
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_HTTPONLY = True
X_FRAME_OPTIONS = "DENY"
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
Expand Down

0 comments on commit ff82661

Please sign in to comment.