mirror of
https://github.com/thecyberlearn/quantum-ai-v3.git
synced 2026-08-18 17:52:57 +00:00
Fix Railway login issue - add CSRF trusted origins
- Add Railway domain to CSRF_TRUSTED_ORIGINS automatically - Include https://netcop.up.railway.app for CSRF token validation - Resolves login form submission issues on Railway deployment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
09e1e3a74c
commit
54d37f90b8
@ -166,6 +166,14 @@ OPENWEATHER_API_KEY = config('OPENWEATHER_API_KEY', default='')
|
|||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
CSRF_TRUSTED_ORIGINS = [origin.strip() for origin in config('CSRF_TRUSTED_ORIGINS', default='').split(',') if origin.strip()]
|
CSRF_TRUSTED_ORIGINS = [origin.strip() for origin in config('CSRF_TRUSTED_ORIGINS', default='').split(',') if origin.strip()]
|
||||||
|
|
||||||
|
# Add Railway domain if running on Railway
|
||||||
|
if config('RAILWAY_ENVIRONMENT', default=''):
|
||||||
|
railway_url = config('RAILWAY_PUBLIC_DOMAIN', default='')
|
||||||
|
if railway_url:
|
||||||
|
CSRF_TRUSTED_ORIGINS.append(f'https://{railway_url}')
|
||||||
|
# Also add common Railway domain pattern
|
||||||
|
CSRF_TRUSTED_ORIGINS.append('https://netcop.up.railway.app')
|
||||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user