@ai-sdk/mcp 2.0.43 → 2.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/tool/oauth.ts +6 -1
package/package.json
CHANGED
package/src/tool/oauth.ts
CHANGED
|
@@ -607,7 +607,12 @@ function assertMetadataIssuerMatches(
|
|
|
607
607
|
metadata: AuthorizationServerMetadata,
|
|
608
608
|
expectedIssuer: string,
|
|
609
609
|
): void {
|
|
610
|
-
|
|
610
|
+
const issuerMatches =
|
|
611
|
+
metadata.issuer === expectedIssuer ||
|
|
612
|
+
(expectedIssuer === new URL(expectedIssuer).origin &&
|
|
613
|
+
metadata.issuer === `${expectedIssuer}/`);
|
|
614
|
+
|
|
615
|
+
if (!issuerMatches) {
|
|
611
616
|
throw new MCPClientOAuthError({
|
|
612
617
|
message: `OAuth authorization server metadata issuer ${metadata.issuer} does not match expected issuer ${expectedIssuer}`,
|
|
613
618
|
});
|