We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da6ac79 commit 6220701Copy full SHA for 6220701
src/client/auth.ts
@@ -299,8 +299,12 @@ export async function discoverOAuthMetadata(
299
): Promise<OAuthMetadata | undefined> {
300
const issuer = new URL(authorizationServerUrl);
301
302
- const wellKnownPath = `/.well-known/oauth-authorization-server${issuer.pathname}`;
303
- const url = new URL(wellKnownPath, authorizationServerUrl);
+ let wellKnownPath = `/.well-known/oauth-authorization-server${issuer.pathname}`;
+ if (issuer.pathname.endsWith('/')) {
304
+ // Strip trailing slash from pathname
305
+ wellKnownPath = wellKnownPath.slice(0, -1);
306
+ }
307
+ const url = new URL(wellKnownPath, issuer);
308
309
let response: Response;
310
try {
0 commit comments