* In useConnection.ts (#924)
- in connect()
- Pass authProvider in transport options
This commit is contained in:
parent
2bf0dd1a03
commit
94ba4c3b56
1 changed files with 4 additions and 0 deletions
|
|
@ -545,6 +545,7 @@ export function useConnection({
|
||||||
requestHeaders["Accept"] = "text/event-stream";
|
requestHeaders["Accept"] = "text/event-stream";
|
||||||
requestHeaders["content-type"] = "application/json";
|
requestHeaders["content-type"] = "application/json";
|
||||||
transportOptions = {
|
transportOptions = {
|
||||||
|
authProvider: serverAuthProvider,
|
||||||
fetch: async (
|
fetch: async (
|
||||||
url: string | URL | globalThis.Request,
|
url: string | URL | globalThis.Request,
|
||||||
init?: RequestInit,
|
init?: RequestInit,
|
||||||
|
|
@ -566,6 +567,7 @@ export function useConnection({
|
||||||
|
|
||||||
case "streamable-http":
|
case "streamable-http":
|
||||||
transportOptions = {
|
transportOptions = {
|
||||||
|
authProvider: serverAuthProvider,
|
||||||
fetch: async (
|
fetch: async (
|
||||||
url: string | URL | globalThis.Request,
|
url: string | URL | globalThis.Request,
|
||||||
init?: RequestInit,
|
init?: RequestInit,
|
||||||
|
|
@ -654,6 +656,7 @@ export function useConnection({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
transportOptions = {
|
transportOptions = {
|
||||||
|
authProvider: serverAuthProvider,
|
||||||
eventSourceInit: {
|
eventSourceInit: {
|
||||||
fetch: (
|
fetch: (
|
||||||
url: string | URL | globalThis.Request,
|
url: string | URL | globalThis.Request,
|
||||||
|
|
@ -675,6 +678,7 @@ export function useConnection({
|
||||||
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
|
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
|
||||||
mcpProxyServerUrl.searchParams.append("url", sseUrl);
|
mcpProxyServerUrl.searchParams.append("url", sseUrl);
|
||||||
transportOptions = {
|
transportOptions = {
|
||||||
|
authProvider: serverAuthProvider,
|
||||||
eventSourceInit: {
|
eventSourceInit: {
|
||||||
fetch: (
|
fetch: (
|
||||||
url: string | URL | globalThis.Request,
|
url: string | URL | globalThis.Request,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue