Log detail CORSMiddleware setup

This commit is contained in:
2024-11-10 20:40:58 -06:00
parent 00620539d8
commit af5e42abe7
2 changed files with 8 additions and 4 deletions

View File

@@ -55,16 +55,19 @@ logger = structlog.get_logger()
if is_development:
from fastapi.middleware.cors import CORSMiddleware
origins = [
"http://localhost",
"http://localhost:5173",
]
app.add_middleware(
CORSMiddleware,
allow_origins=[
"http://localhost",
"http://localhost:5173",
],
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
logger.info("CORS Enabled", origins=origins)
app.add_middleware(LoggingMiddleware)
app.add_middleware(CorrelationIdMiddleware)

View File

@@ -15,6 +15,7 @@ logger = structlog.get_logger()
router = APIRouter()
hasher = PasswordHash([Argon2Hasher()])
# cspell: disable
dummy_hash = (
"$argon2id$v=19$m=65536,t=3,p=4$Ii3hm5/NqcJddQDFK24Wtw$I99xV/qkaLROo0VZcvaZrYMAD9RTcWzxY5/RbMoRLQ4"
)