server: allow CORS credentials

This commit is contained in:
2023-10-18 12:41:15 +02:00
parent c55f038ed4
commit 86f4de7958
2 changed files with 2 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ else:
app = FastAPI(lifespan=lifespan)
app.add_middleware(
CORSMiddleware,
allow_credentials=settings.CORS_ALLOW_CREDENTIALS or False,
allow_origins=settings.CORS_ORIGIN.split(","),
allow_methods=["*"],
allow_headers=["*"],

View File

@@ -8,6 +8,7 @@ class Settings(BaseSettings):
# CORS
CORS_ORIGIN: str = "*"
CORS_ALLOW_CREDENTIALS: bool = False
# Database
DATABASE_URL: str = "sqlite:///./reflector.sqlite3"