Browse Source

Merge pull request #18261 from Classic298/patch-1

enh: lower JWT expiration default value and add warn message
Tim Jaeryang Baek 4 months ago
parent
commit
94806555bf
1 changed files with 7 additions and 1 deletions
  1. 7 1
      backend/open_webui/config.py

+ 7 - 1
backend/open_webui/config.py

@@ -307,9 +307,15 @@ API_KEY_ALLOWED_ENDPOINTS = PersistentConfig(
 
 
 JWT_EXPIRES_IN = PersistentConfig(
-    "JWT_EXPIRES_IN", "auth.jwt_expiry", os.environ.get("JWT_EXPIRES_IN", "-1")
+    "JWT_EXPIRES_IN", "auth.jwt_expiry", os.environ.get("JWT_EXPIRES_IN", "4w")
 )
 
+if JWT_EXPIRES_IN.value == "-1":
+    log.warning(
+        "⚠️  SECURITY WARNING: JWT_EXPIRES_IN is set to '-1'\n"
+        "    See: https://docs.openwebui.com/getting-started/env-configuration\n"
+    )
+
 ####################################
 # OAuth config
 ####################################