Skip to content

Commit 3998b5a

Browse files
Fix endpoint usage
1 parent 379df23 commit 3998b5a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/mcp-express/src/middlewares/bearerAuthMiddleware.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export default function bearerAuthMiddleware(options: McpAuthOptions) {
5050
const issuer: string | undefined = options?.issuer;
5151
const endpoints:
5252
| {
53+
authorize?: string | undefined;
5354
jwks?: string | undefined;
55+
token?: string | undefined;
5456
}
5557
| undefined = options?.endpoints;
5658

packages/mcp-node/src/utils/generate-authorization-server-metadata.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export default function generateAuthorizationServerMetadata(
3131
const {issuer, endpoints} = options;
3232

3333
const metadata: AuthorizationServerMetadata = {
34-
authorization_endpoint: `${options.baseUrl}${endpoints?.authorize ?? '/oauth2/authorize'}`,
34+
authorization_endpoint: endpoints?.authorize ?? `${options.baseUrl}/oauth2/authorize`,
3535
issuer: `${issuer}`,
3636
response_types_supported: ['code'],
37-
token_endpoint: `${options.baseUrl}${endpoints?.token ?? '/oauth2/token'}`,
37+
token_endpoint: endpoints?.token ?? `${options.baseUrl}/oauth2/token`,
3838
};
3939

4040
// TODO: Check this further.
@@ -59,7 +59,7 @@ export default function generateAuthorizationServerMetadata(
5959
}
6060

6161
// TODO: Check this further.
62-
metadata.jwks_uri = `${options.baseUrl}${endpoints?.jwks ?? '/oauth/jwks'}`;
62+
metadata.jwks_uri = endpoints?.jwks ?? `${options.baseUrl}/oauth/jwks`;
6363

6464
return metadata;
6565
}

0 commit comments

Comments
 (0)