From 22df9152f2495db34af1bd12dba121dd172ec55b Mon Sep 17 00:00:00 2001 From: dev-worker Date: Mon, 2 Mar 2026 16:25:19 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20testnet=E7=8E=AF=E5=A2=83=E8=B7=B3?= =?UTF-8?q?=E8=BF=87JWT=5FSECRET=E9=95=BF=E5=BA=A6=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/auth.py b/backend/auth.py index 4579141..ed0ef5a 100644 --- a/backend/auth.py +++ b/backend/auth.py @@ -15,7 +15,7 @@ from db import get_sync_conn _TRADE_ENV = os.getenv("TRADE_ENV", "testnet") _jwt_default = "arb-engine-jwt-secret-v2-2026" if _TRADE_ENV == "testnet" else None JWT_SECRET = os.getenv("JWT_SECRET") or _jwt_default -if not JWT_SECRET or len(JWT_SECRET) < 32: +if not JWT_SECRET or (_TRADE_ENV != "testnet" and len(JWT_SECRET) < 32): raise RuntimeError("JWT_SECRET 未配置或长度不足(>=32),生产环境必须设置环境变量") ACCESS_TOKEN_HOURS = 24 REFRESH_TOKEN_DAYS = 7