File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -401,7 +401,8 @@ export namespace MCP {
401401 // but may also throw plain Errors when auth() fails internally
402402 // (e.g. during discovery, registration, or state generation).
403403 // When an authProvider is attached, treat both cases as auth-related.
404- const isAuthError = error instanceof UnauthorizedError || ( authProvider && lastError . message . includes ( "OAuth" ) )
404+ const isAuthError =
405+ error instanceof UnauthorizedError || ( authProvider && lastError . message . includes ( "OAuth" ) )
405406 if ( isAuthError ) {
406407 log . info ( "mcp server requires authentication" , { key, transport : name } )
407408
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ let simulateAuthFlow = true
2222// Mock the transport constructors to simulate OAuth auto-auth on 401
2323mock . module ( "@modelcontextprotocol/sdk/client/streamableHttp.js" , ( ) => ( {
2424 StreamableHTTPClientTransport : class MockStreamableHTTP {
25- authProvider : {
26- state ?: ( ) => Promise < string >
27- redirectToAuthorization ?: ( url : URL ) => Promise < void >
28- saveCodeVerifier ?: ( v : string ) => Promise < void >
29- } | undefined
25+ authProvider :
26+ | {
27+ state ?: ( ) => Promise < string >
28+ redirectToAuthorization ?: ( url : URL ) => Promise < void >
29+ saveCodeVerifier ?: ( v : string ) => Promise < void >
30+ }
31+ | undefined
3032 constructor ( url : URL , options ?: { authProvider ?: unknown } ) {
3133 this . authProvider = options ?. authProvider as typeof this . authProvider
3234 transportCalls . push ( {
You can’t perform that action at this time.
0 commit comments