Skip to content

Commit 60676bf

Browse files
committed
refac
1 parent 2734fca commit 60676bf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

backend/open_webui/routers/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async def get_tools(
120120
auth_type = server.get('auth_type', 'none')
121121

122122
session_token = None
123-
if auth_type == 'oauth_2.1':
123+
if auth_type in ('oauth_2.1', 'oauth_2.1_static'):
124124
splits = server_id.split(':')
125125
server_id = splits[-1] if len(splits) > 1 else server_id
126126

@@ -148,7 +148,7 @@ async def get_tools(
148148
{
149149
'authenticated': session_token is not None,
150150
}
151-
if auth_type == 'oauth_2.1'
151+
if auth_type in ('oauth_2.1', 'oauth_2.1_static')
152152
else {}
153153
),
154154
}

backend/open_webui/utils/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,7 +2512,7 @@ async def process_chat_payload(request, form_data, user, metadata, model):
25122512
oauth_token = extra_params.get('__oauth_token__', None)
25132513
if oauth_token:
25142514
headers['Authorization'] = f'Bearer {oauth_token.get("access_token", "")}'
2515-
elif auth_type == 'oauth_2.1':
2515+
elif auth_type in ('oauth_2.1', 'oauth_2.1_static'):
25162516
try:
25172517
splits = server_id.split(':')
25182518
server_id = splits[-1] if len(splits) > 1 else server_id

0 commit comments

Comments
 (0)