Skip to content

Commit a0e221a

Browse files
committed
Merge branch 'feature/auth-service-workflow' of github.com:Devasy23/splitwiser into feature/auth-service-workflow
2 parents 1f8ae64 + aedb6d1 commit a0e221a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

backend/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ FIREBASE_SERVICE_ACCOUNT_PATH=./firebase-service-account.json
1313

1414
# CORS Configuration
1515
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173,http://127.0.0.1:3000,http://127.0.0.1:5173
16+
ALLOW_ALL_ORIGINS=False

backend/app/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class Settings(BaseSettings):
2929
firebase_client_x509_cert_url: Optional[str] = None
3030
# App
3131
debug: bool = False
32-
33-
# CORS - Add your frontend domain here for production
34-
allowed_origins: str = "http://localhost:3000,http://localhost:5173,http://127.0.0.1:3000,http://127.0.0.1:5173,https://127.0.0.1:8081"
32+
# CORS - Add your frontend domain here for production
33+
allowed_origins: str = "http://localhost:3000,http://localhost:5173,http://127.0.0.1:3000,http://localhost:8081"
34+
allow_all_origins: bool = False
3535

3636
class Config:
3737
env_file = ".env"

backend/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515

1616
# CORS middleware - Enhanced configuration for production
1717
allowed_origins = []
18-
if settings.allowed_origins:
18+
if settings.allow_all_origins:
19+
# Allow all origins in development mode
20+
allowed_origins = ["*"]
21+
print("Development mode: CORS configured to allow all origins")
22+
elif settings.allowed_origins:
23+
# Use specified origins in production mode
1924
allowed_origins = [origin.strip() for origin in settings.allowed_origins.split(",") if origin.strip()]
2025
else:
2126
# Fallback to allow all origins if not specified (not recommended for production)

0 commit comments

Comments
 (0)