@@ -86,18 +86,14 @@ test('OAuth integration flow works end-to-end', async () => {
8686 wwwAuthHeader ,
8787 '🚨 WWW-Authenticate header should contain OAuth realm' ,
8888 ) . toContain ( 'OAuth realm="EpicMe"' )
89- expect (
90- wwwAuthHeader ,
91- '🚨 WWW-Authenticate header should contain authorization_url' ,
92- ) . toContain ( 'authorization_url=' )
9389
94- // Extract the authorization URL from the header
95- const authUrlMatch = wwwAuthHeader ?. match ( / a u t h o r i z a t i o n _ u r l = " ( [ ^ " ] + ) " / )
90+ // Extract the authorization URL from the Location header
91+ const locationHeader = unauthorizedResponse . headers . get ( 'Location' )
9692 expect (
97- authUrlMatch ,
98- '🚨 Could not extract authorization URL from WWW-Authenticate header ' ,
93+ locationHeader ,
94+ '🚨 Location header should be present with authorization URL ' ,
9995 ) . toBeTruthy ( )
100- const authorizationUrl = authUrlMatch ! [ 1 ]
96+ const authorizationUrl = locationHeader
10197 expect (
10298 authorizationUrl ,
10399 '🚨 Authorization URL should not be empty' ,
@@ -138,7 +134,7 @@ test('OAuth integration flow works end-to-end', async () => {
138134 expect (
139135 protectedResourceConfig . resource ,
140136 '🚨 Resource identifier should be present' ,
141- ) . toBe ( 'epicme- mcp' )
137+ ) . toBe ( ` ${ EPIC_ME_SERVER_URL } / mcp` )
142138 expect (
143139 protectedResourceConfig . scopes ,
144140 '🚨 Scopes should be present' ,
0 commit comments