From c274e50ee0542f3e24cf49565250030d6eba2806 Mon Sep 17 00:00:00 2001 From: king Date: Sun, 24 May 2026 13:04:02 +0900 Subject: [PATCH] =?UTF-8?q?feat(sso):=20SESSION=5FMAX=5FAGE=EB=A5=BC=20env?= =?UTF-8?q?=EB=A1=9C=20=EB=85=B8=EC=B6=9C=20=E2=80=94=20OMS=EC=99=80=20?= =?UTF-8?q?=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SessionMiddleware max_age 를 SESSION_MAX_AGE 환경변수에서 읽도록 변경 (기본 28800초=8h, OMS .env.example 과 일치) - .env.example 에 SESSION_MAX_AGE 항목 추가 - run-local.ps1 을 .gitignore 에 추가 (run-local.bat 와 동일 정책 — 로컬 전용) --- .env.example | 2 ++ .gitignore | 1 + app/main.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 430234a..f2c28e5 100644 --- a/.env.example +++ b/.env.example @@ -4,6 +4,8 @@ GOOGLE_CLIENT_SECRET=your-google-oauth-client-secret SESSION_SECRET_KEY=replace-with-a-long-random-secret SESSION_COOKIE_NAME=session SESSION_COOKIE_SECURE=true +# 세션 유효기간(초). OMS(orderlist) 와 동일하게 맞출 것. 28800=8h +SESSION_MAX_AGE=28800 PUBLIC_BASE_URL=https://dbx.no1king.freeddns.org CS_ORDER_URL=https://cs.example.com # 비워두면 같은 도메인의 /orderlist/ 경로(NPM 리버스 프록시)로 자동 연결됨 diff --git a/.gitignore b/.gitignore index f011799..2b1c845 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # 로컬 전용 스크립트 (자격증명 포함 가능) push-gitea.bat run-local.bat +run-local.ps1 # Python __pycache__/ diff --git a/app/main.py b/app/main.py index b981044..147c0fe 100644 --- a/app/main.py +++ b/app/main.py @@ -51,7 +51,7 @@ app.add_middleware( session_cookie=env("SESSION_COOKIE_NAME", SESSION_COOKIE_DEFAULT), https_only=env("SESSION_COOKIE_SECURE", "true").lower() == "true", same_site="lax", - max_age=60 * 60 * 8, + max_age=int(env("SESSION_MAX_AGE", "28800")), path="/", ) app.mount("/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static")