mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
refactor(ui): useTestMCPConnection uses the shared isClientForwardedTokenMode helper
The helper extraction missed this call site, leaving an inline duplicate of the two-mode check that could drift from the shared definition
This commit is contained in:
parent
bff2c952e0
commit
43726f2d0b
1 changed files with 2 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { useState, useEffect, useCallback } from "react";
|
||||
import { testMCPToolsListRequest } from "../components/networking";
|
||||
import { AUTH_TYPE, OAUTH_FLOW, TRANSPORT } from "@/components/mcp_tools/types";
|
||||
import { AUTH_TYPE, OAUTH_FLOW, TRANSPORT, isClientForwardedTokenMode } from "@/components/mcp_tools/types";
|
||||
|
||||
interface MCPServerConfig {
|
||||
server_id?: string;
|
||||
|
|
@ -56,8 +56,7 @@ export const useTestMCPConnection = ({
|
|||
|
||||
// Check if we have the minimum required fields to fetch tools
|
||||
const isM2MOAuth = formValues.auth_type === AUTH_TYPE.OAUTH2 && formValues.oauth_flow_type === OAUTH_FLOW.M2M;
|
||||
const isBrowserHeldTokenMode =
|
||||
formValues.auth_type === AUTH_TYPE.TRUE_PASSTHROUGH || formValues.auth_type === AUTH_TYPE.OAUTH_DELEGATE;
|
||||
const isBrowserHeldTokenMode = isClientForwardedTokenMode(formValues.auth_type);
|
||||
const requiresOAuthToken = (formValues.auth_type === AUTH_TYPE.OAUTH2 && !isM2MOAuth) || isBrowserHeldTokenMode;
|
||||
const isOpenAPITransport = formValues.transport === TRANSPORT.OPENAPI;
|
||||
const hasEndpoint = isOpenAPITransport ? !!formValues.spec_path : !!formValues.url;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue