From d1c19212d66b2c7af04f607a961ff7bb39d7f548 Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Sat, 21 Feb 2026 14:26:27 -0500 Subject: [PATCH] Fix CORS policy for production deployment --- backend/app/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/app/main.py b/backend/app/main.py index aa47201..3ef9f16 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -27,9 +27,16 @@ app = FastAPI( ) # CORS middleware +origins = [ + "http://localhost:5173", + "http://127.0.0.1:5173", + "https://sibu2-0-transport-2026.web.app", + "https://sibu2-0-transport-2026.firebaseapp.com", +] + app.add_middleware( CORSMiddleware, - allow_origins=["*"], # Configure properly for production + allow_origins=origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"],