From f280dc6ac84d0f889ebb27d600806703b5961b9c Mon Sep 17 00:00:00 2001 From: Dennis Chen Date: Wed, 5 Jun 2024 10:19:33 -0700 Subject: [PATCH] only add necessary cors stuff --- store/app/api/routers/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/store/app/api/routers/main.py b/store/app/api/routers/main.py index e217ec94..a718beac 100644 --- a/store/app/api/routers/main.py +++ b/store/app/api/routers/main.py @@ -8,7 +8,9 @@ from fastapi import APIRouter, FastAPI, HTTPException, status from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel + from store.app.api.routers.users import users_router +from store.settings import settings logger = logging.getLogger(__name__) @@ -18,8 +20,8 @@ app.add_middleware( CORSMiddleware, - allow_origins=["*"], # Allow all origins - # allow_credentials=True, + allow_origins=[settings.site.homepage], # Allow all origins + allow_credentials=True, allow_methods=["*"], # Allow all methods allow_headers=["*"], # Allow all headers )