mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 05:45:19 +00:00
refac/fix
This commit is contained in:
parent
f1c317349e
commit
0bf686396d
1 changed files with 12 additions and 7 deletions
|
|
@ -277,11 +277,14 @@ async def verify_tool_servers_config(
|
||||||
user.id,
|
user.id,
|
||||||
request.cookies.get("oauth_session_id", None),
|
request.cookies.get("oauth_session_id", None),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if oauth_token:
|
||||||
|
token = oauth_token.get("access_token", "")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if oauth_token:
|
if token:
|
||||||
headers = {"Authorization": f"Bearer {oauth_token.get('access_token', '')}"}
|
headers = {"Authorization": f"Bearer {token}"}
|
||||||
|
|
||||||
await client.connect(form_data.url, headers=headers)
|
await client.connect(form_data.url, headers=headers)
|
||||||
specs = await client.list_tool_specs()
|
specs = await client.list_tool_specs()
|
||||||
|
|
@ -307,13 +310,15 @@ async def verify_tool_servers_config(
|
||||||
elif form_data.auth_type == "system_oauth":
|
elif form_data.auth_type == "system_oauth":
|
||||||
try:
|
try:
|
||||||
if request.cookies.get("oauth_session_id", None):
|
if request.cookies.get("oauth_session_id", None):
|
||||||
oauth_token = await request.app.state.oauth_manager.get_oauth_token(
|
oauth_token = (
|
||||||
user.id,
|
await request.app.state.oauth_manager.get_oauth_token(
|
||||||
request.cookies.get("oauth_session_id", None),
|
user.id,
|
||||||
|
request.cookies.get("oauth_session_id", None),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if oauth_token:
|
if oauth_token:
|
||||||
token = f"{oauth_token.get('access_token', '')}"
|
token = oauth_token.get("access_token", "")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue