tethysplatform / tethys

The Tethys Platform main Django website project repository.
http://tethysplatform.org/
BSD 2-Clause "Simplified" License
92 stars 50 forks source link

Full React Support #836

Open swainn opened 2 years ago

swainn commented 2 years ago

PR #824 adds experimental support for React-based Tethys apps. This issue documents what needs to be done to make it a fully supported feature:

# Cookie Settings
CSRF_COOKIE_SAMESITE = 'Lax'
SESSION_COOKIE_SAMESITE = 'Lax'

# Prevent JavaScript from accessing CSRF and session cookies
# NOTE: This will probably break scripts that use the cookie to get the CSRF token
CSRF_COOKIE_HTTPONLY = True
SESSION_COOKIE_HTTPONLY = True

# Production only
CSRF_COOKIE_SECURE = not DEBUG
SESSION_COOKIE_SECURE = not DEBUG

# CORS Header Settings
CORS_ALLOWED_ORIGINS = [
    'http://localhost:8080',
    'http://127.0.0.1:8080',
]

CORS_EXPOSE_HEADERS = [
    'Content-Type',
    'X-CSRFToken',
]

CORS_ALLOW_CREDENTIALS = True
swainn commented 9 months ago

See #970 as an alternative for React support in Tethys.