@@ -938,8 +938,7 @@ describe("OAuth Authorization", () => {
938938
939939 // Call the auth function with a resource that has a fragment
940940 const result = await auth ( mockProvider , {
941- serverUrl : "https://resource.example.com" ,
942- resource : new URL ( "https://api.example.com/mcp-server#fragment" ) ,
941+ serverUrl : "https://api.example.com/mcp-server#fragment" ,
943942 } ) ;
944943
945944 expect ( result ) . toBe ( "REDIRECT" ) ;
@@ -987,8 +986,7 @@ describe("OAuth Authorization", () => {
987986
988987 // Call auth without authorization code (should trigger redirect)
989988 const result = await auth ( mockProvider , {
990- serverUrl : "https://resource.example.com" ,
991- resource : new URL ( "https://api.example.com/mcp-server" ) ,
989+ serverUrl : "https://api.example.com/mcp-server" ,
992990 } ) ;
993991
994992 expect ( result ) . toBe ( "REDIRECT" ) ;
@@ -1048,9 +1046,8 @@ describe("OAuth Authorization", () => {
10481046
10491047 // Call auth with authorization code
10501048 const result = await auth ( mockProvider , {
1051- serverUrl : "https://resource .example.com" ,
1049+ serverUrl : "https://api .example.com/mcp-server " ,
10521050 authorizationCode : "auth-code-123" ,
1053- resource : new URL ( "https://api.example.com/mcp-server" ) ,
10541051 } ) ;
10551052
10561053 expect ( result ) . toBe ( "AUTHORIZED" ) ;
@@ -1111,8 +1108,7 @@ describe("OAuth Authorization", () => {
11111108
11121109 // Call auth with existing tokens (should trigger refresh)
11131110 const result = await auth ( mockProvider , {
1114- serverUrl : "https://resource.example.com" ,
1115- resource : new URL ( "https://api.example.com/mcp-server" ) ,
1111+ serverUrl : "https://api.example.com/mcp-server" ,
11161112 } ) ;
11171113
11181114 expect ( result ) . toBe ( "AUTHORIZED" ) ;
@@ -1160,8 +1156,7 @@ describe("OAuth Authorization", () => {
11601156
11611157 // Call auth with empty resource parameter
11621158 const result = await auth ( mockProvider , {
1163- serverUrl : "https://resource.example.com" ,
1164- resource : undefined ,
1159+ serverUrl : "https://api.example.com/mcp-server" ,
11651160 } ) ;
11661161
11671162 expect ( result ) . toBe ( "REDIRECT" ) ;
@@ -1203,8 +1198,7 @@ describe("OAuth Authorization", () => {
12031198
12041199 // Call auth with resource containing multiple # symbols
12051200 const result = await auth ( mockProvider , {
1206- serverUrl : "https://resource.example.com" ,
1207- resource : new URL ( "https://api.example.com/mcp-server#fragment#another" ) ,
1201+ serverUrl : "https://api.example.com/mcp-server#fragment#another" ,
12081202 } ) ;
12091203
12101204 expect ( result ) . toBe ( "REDIRECT" ) ;
@@ -1248,8 +1242,7 @@ describe("OAuth Authorization", () => {
12481242 // This tests the security fix that prevents token confusion between
12491243 // multiple MCP servers on the same domain
12501244 const result1 = await auth ( mockProvider , {
1251- serverUrl : "https://api.example.com" ,
1252- resource : new URL ( "https://api.example.com/mcp-server-1/v1" ) ,
1245+ serverUrl : "https://api.example.com/mcp-server-1/v1" ,
12531246 } ) ;
12541247
12551248 expect ( result1 ) . toBe ( "REDIRECT" ) ;
@@ -1263,8 +1256,7 @@ describe("OAuth Authorization", () => {
12631256
12641257 // Test with different path on same domain
12651258 const result2 = await auth ( mockProvider , {
1266- serverUrl : "https://api.example.com" ,
1267- resource : new URL ( "https://api.example.com/mcp-server-2/v1" ) ,
1259+ serverUrl : "https://api.example.com/mcp-server-2/v1" ,
12681260 } ) ;
12691261
12701262 expect ( result2 ) . toBe ( "REDIRECT" ) ;
@@ -1308,8 +1300,7 @@ describe("OAuth Authorization", () => {
13081300
13091301 // Call auth with resource containing query parameters
13101302 const result = await auth ( mockProvider , {
1311- serverUrl : "https://resource.example.com" ,
1312- resource : new URL ( "https://api.example.com/mcp-server?param=value&another=test" ) ,
1303+ serverUrl : "https://api.example.com/mcp-server?param=value&another=test" ,
13131304 } ) ;
13141305
13151306 expect ( result ) . toBe ( "REDIRECT" ) ;
0 commit comments