diff options
| author | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-04-29 02:08:02 +0300 |
|---|---|---|
| committer | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-04-29 02:08:02 +0300 |
| commit | ea58f7b3b514098f365c50facc5fc212459acac0 (patch) | |
| tree | 64924839f51d274cd710b1e88ed0edcad8d7f812 /app/main.py | |
| parent | 5d18f873e9b72bd00d69e42a10c566d44a0c5255 (diff) | |
add google auth
Diffstat (limited to 'app/main.py')
| -rw-r--r-- | app/main.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/main.py b/app/main.py index 49e7a1f..2aeead8 100644 --- a/app/main.py +++ b/app/main.py @@ -1,3 +1,4 @@ +import os import time from contextlib import asynccontextmanager from pathlib import Path @@ -5,6 +6,7 @@ from pathlib import Path from dotenv import load_dotenv from fastapi import FastAPI from sqlalchemy import text +from starlette.middleware.sessions import SessionMiddleware from app.routes import router as api_router from app.utils.cors import setup_cors @@ -61,5 +63,11 @@ async def lifespan(app: FastAPI): app = FastAPI(lifespan=lifespan) +app.add_middleware( + SessionMiddleware, + secret_key=os.getenv("SESSION_SECRET_KEY", "dev-secret"), + same_site="lax", + https_only=False, +) setup_cors(app) app.include_router(api_router, prefix="/api") |
