refac
This commit is contained in:
@@ -120,7 +120,7 @@ async def get_tools(
|
|||||||
auth_type = server.get('auth_type', 'none')
|
auth_type = server.get('auth_type', 'none')
|
||||||
|
|
||||||
session_token = None
|
session_token = None
|
||||||
if auth_type == 'oauth_2.1':
|
if auth_type in ('oauth_2.1', 'oauth_2.1_static'):
|
||||||
splits = server_id.split(':')
|
splits = server_id.split(':')
|
||||||
server_id = splits[-1] if len(splits) > 1 else server_id
|
server_id = splits[-1] if len(splits) > 1 else server_id
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ async def get_tools(
|
|||||||
{
|
{
|
||||||
'authenticated': session_token is not None,
|
'authenticated': session_token is not None,
|
||||||
}
|
}
|
||||||
if auth_type == 'oauth_2.1'
|
if auth_type in ('oauth_2.1', 'oauth_2.1_static')
|
||||||
else {}
|
else {}
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2512,7 +2512,7 @@ async def process_chat_payload(request, form_data, user, metadata, model):
|
|||||||
oauth_token = extra_params.get('__oauth_token__', None)
|
oauth_token = extra_params.get('__oauth_token__', None)
|
||||||
if oauth_token:
|
if oauth_token:
|
||||||
headers['Authorization'] = f'Bearer {oauth_token.get("access_token", "")}'
|
headers['Authorization'] = f'Bearer {oauth_token.get("access_token", "")}'
|
||||||
elif auth_type == 'oauth_2.1':
|
elif auth_type in ('oauth_2.1', 'oauth_2.1_static'):
|
||||||
try:
|
try:
|
||||||
splits = server_id.split(':')
|
splits = server_id.split(':')
|
||||||
server_id = splits[-1] if len(splits) > 1 else server_id
|
server_id = splits[-1] if len(splits) > 1 else server_id
|
||||||
|
|||||||
Reference in New Issue
Block a user