Merge pull request #11 from okapteinis/claude/pr-review-fixes-01WNkTGGrYURxe9JATA3gX6y

Fix CORS configuration to prevent startup error
This commit is contained in:
Ojārs Kapteinis 2025-11-19 00:34:55 +02:00 committed by GitHub
commit b04e3420f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View file

@ -32,8 +32,10 @@ AUTH_TYPE=LOCAL
REGISTRATION_ENABLED=TRUE or FALSE REGISTRATION_ENABLED=TRUE or FALSE
# CORS Configuration (comma-separated list of allowed origins) # CORS Configuration (comma-separated list of allowed origins)
# Use * to allow all origins, or specify domains like: https://example.com,https://app.example.com # WARNING: Do not use "*" - it's incompatible with credentials and insecure for production
CORS_ORIGINS=* # Defaults to NEXT_FRONTEND_URL if not set
# Example: CORS_ORIGINS=https://example.com,https://app.example.com
# CORS_ORIGINS=http://localhost:3000
# Google OAuth Credentials (OPTIONAL - Required only for Gmail and Google Calendar connectors) # Google OAuth Credentials (OPTIONAL - Required only for Gmail and Google Calendar connectors)
GOOGLE_OAUTH_CLIENT_ID=your_google_client_id GOOGLE_OAUTH_CLIENT_ID=your_google_client_id

View file

@ -136,8 +136,9 @@ class Config:
REGISTRATION_ENABLED = os.getenv("REGISTRATION_ENABLED", "TRUE").upper() == "TRUE" REGISTRATION_ENABLED = os.getenv("REGISTRATION_ENABLED", "TRUE").upper() == "TRUE"
# CORS Configuration # CORS Configuration
# Comma-separated list of allowed origins, defaults to all origins if not set # Comma-separated list of allowed origins, defaults to frontend URL
_cors_origins_str = os.getenv("CORS_ORIGINS", "*") # Note: Wildcard "*" is not allowed when allow_credentials=True
_cors_origins_str = os.getenv("CORS_ORIGINS", os.getenv("NEXT_FRONTEND_URL", "http://localhost:3000"))
CORS_ORIGINS = [origin.strip() for origin in _cors_origins_str.split(",") if origin.strip()] CORS_ORIGINS = [origin.strip() for origin in _cors_origins_str.split(",") if origin.strip()]
# Google OAuth # Google OAuth