Update auth.ts

This commit is contained in:
Henry Mao 2025-07-04 11:14:14 +08:00 • committed by GitHub
commit c5fcba4617
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -320,8 +320,8 @@ async function fetchWithCorsRetry(
/**
* Constructs the well-known path for OAuth metadata discovery
*/
function buildWellKnownPath(wellKnownPath: string, pathname: string): string {
let wellKnownPath = `/.well-known/${wellKnownPath}${pathname}`;
function buildWellKnownPath(wellKnownPrefix: string, pathname: string): string {
let wellKnownPath = `/.well-known/${wellKnownPrefix}${pathname}`;
if (pathname.endsWith('/')) {
// Strip trailing slash from pathname to avoid double slashes
wellKnownPath = wellKnownPath.slice(0, -1);