Skip to content

Commit 4f24b8b

Browse files
authored
Fix /.well-known/oauth-authorization-server dropping path
1 parent cb4743d commit 4f24b8b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/client/auth.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ export async function discoverOAuthMetadata(
297297
authorizationServerUrl: string | URL,
298298
opts?: { protocolVersion?: string },
299299
): Promise<OAuthMetadata | undefined> {
300-
const url = new URL("/.well-known/oauth-authorization-server", authorizationServerUrl);
300+
const wellKnownPath = `/.well-known/oauth-authorization-server${issuer.pathname}`;
301+
const url = new URL(wellKnownPath, authorizationServerUrl);
302+
301303
let response: Response;
302304
try {
303305
response = await fetch(url, {

0 commit comments

Comments
 (0)