Fix /.well-known/oauth-authorization-server dropping path

This commit is contained in:
Henry Mao 2025-06-24 04:36:54 +08:00 • committed by GitHub
commit 4f24b8bc6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -297,7 +297,9 @@ export async function discoverOAuthMetadata(
authorizationServerUrl: string | URL,
opts?: { protocolVersion?: string },
): Promise<OAuthMetadata | undefined> {
const url = new URL("/.well-known/oauth-authorization-server", authorizationServerUrl);
const wellKnownPath = `/.well-known/oauth-authorization-server${issuer.pathname}`;
const url = new URL(wellKnownPath, authorizationServerUrl);
let response: Response;
try {
response = await fetch(url, {