From d1d2bd55a00de5e93cb79e5365df8f2fb30e43ef Mon Sep 17 00:00:00 2001 From: MingxuanGame Date: Sat, 4 Oct 2025 08:04:23 +0000 Subject: [PATCH] fix(security): raise RuntimeError for unset jwt_secret_key to enhance server safety --- main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index a9ebed6..f6e8e87 100644 --- a/main.py +++ b/main.py @@ -260,9 +260,8 @@ async def http_exception_handler(request: Request, exc: HTTPException): # noqa: if settings.secret_key == "your_jwt_secret_here": # noqa: S105 - system_logger("Security").opt(colors=True).warning( - "jwt_secret_key is unset. Your server is unsafe. " - "Use this command to generate: openssl rand -hex 32." + raise RuntimeError( + "jwt_secret_key is unset. Your server is unsafe. Use this command to generate: openssl rand -hex 32" ) if settings.osu_web_client_secret == "your_osu_web_client_secret_here": # noqa: S105 system_logger("Security").opt(colors=True).warning(