Skip to content

Commit ab816bd

Browse files
committed
fix some tests
1 parent 5e3f63f commit ab816bd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

client/src/components/__tests__/AuthDebugger.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jest.mock("@modelcontextprotocol/sdk/client/auth.js", () => ({
4141
startAuthorization: jest.fn(),
4242
exchangeAuthorization: jest.fn(),
4343
discoverOAuthProtectedResourceMetadata: jest.fn(),
44+
selectResourceURL: jest.fn(),
4445
}));
4546

4647
// Import the functions to get their types

client/src/lib/oauth-state-machine.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
4949
}
5050
}
5151

52-
const resource = selectResourceURL(
52+
const resource: URL | undefined = await selectResourceURL(
5353
context.serverUrl,
5454
context.provider,
55-
resourceMetadata,
55+
// we default to null, so swap it for undefined if not set
56+
resourceMetadata ?? undefined,
5657
);
5758

5859
const metadata = await discoverOAuthMetadata(authServerUrl);

0 commit comments

Comments
 (0)