|
@@ -817,10 +817,11 @@ async def process_chat_payload(request, form_data, user, metadata, model):
|
|
|
|
|
|
oauth_token = None
|
|
|
try:
|
|
|
- oauth_token = request.app.state.oauth_manager.get_oauth_token(
|
|
|
- user.id,
|
|
|
- request.cookies.get("oauth_session_id", None),
|
|
|
- )
|
|
|
+ if request.cookies.get("oauth_session_id", None):
|
|
|
+ oauth_token = request.app.state.oauth_manager.get_oauth_token(
|
|
|
+ user.id,
|
|
|
+ request.cookies.get("oauth_session_id", None),
|
|
|
+ )
|
|
|
except Exception as e:
|
|
|
log.error(f"Error getting OAuth token: {e}")
|
|
|
|
|
@@ -1496,10 +1497,11 @@ async def process_chat_response(
|
|
|
|
|
|
oauth_token = None
|
|
|
try:
|
|
|
- oauth_token = request.app.state.oauth_manager.get_oauth_token(
|
|
|
- user.id,
|
|
|
- request.cookies.get("oauth_session_id", None),
|
|
|
- )
|
|
|
+ if request.cookies.get("oauth_session_id", None):
|
|
|
+ oauth_token = request.app.state.oauth_manager.get_oauth_token(
|
|
|
+ user.id,
|
|
|
+ request.cookies.get("oauth_session_id", None),
|
|
|
+ )
|
|
|
except Exception as e:
|
|
|
log.error(f"Error getting OAuth token: {e}")
|
|
|
|