From 422d38fd114b1ebd8a7dbb114d64e14791e67d7a Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 25 Sep 2025 01:56:09 -0500 Subject: [PATCH] refac --- backend/open_webui/main.py | 2 +- backend/open_webui/routers/configs.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 180406c942..c6930f9b99 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1900,7 +1900,7 @@ if len(app.state.config.TOOL_SERVER_CONNECTIONS) > 0: auth_type = tool_server_connection.get("auth_type", "none") if server_id and auth_type == "oauth_2.1": oauth_client_info = tool_server_connection.get("info", {}).get( - "oauth_client_info" + "oauth_client_info", "" ) oauth_client_info = decrypt_data(oauth_client_info) diff --git a/backend/open_webui/routers/configs.py b/backend/open_webui/routers/configs.py index 76b9bc77a1..d4b88032e2 100644 --- a/backend/open_webui/routers/configs.py +++ b/backend/open_webui/routers/configs.py @@ -178,7 +178,11 @@ async def set_tool_servers_config( auth_type = connection.get("auth_type", "none") if auth_type == "oauth_2.1" and server_id: try: + oauth_client_info = connection.get("info", {}).get( + "oauth_client_info", "" + ) oauth_client_info = decrypt_data(oauth_client_info) + await request.app.state.oauth_client_manager.add_client( f"{server_type}:{server_id}", OAuthClientInformationFull(**oauth_client_info),