Skip to content

Commit 5360e03

Browse files
author
itsuki
committed
resource server url using the base url
1 parent dcdc92f commit 5360e03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/client/auth.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export async function auth(
8686
provider: OAuthClientProvider,
8787
{ resourceServerUrl, authorizationCode, authServerUrl }: { resourceServerUrl: string | URL, authorizationCode?: string, authServerUrl?: string | URL }): Promise<AuthResult> {
8888

89-
let authorizationServerUrl = authServerUrl
89+
let authorizationServerUrl = authServerUrl
9090

9191
if (!authorizationServerUrl) {
9292
const protectedResourceMetadata = await discoverOAuthProtectedResourceMetadata(resourceServerUrl);
@@ -338,7 +338,7 @@ export async function startAuthorization(
338338
codeChallengeMethod,
339339
);
340340
authorizationUrl.searchParams.set("redirect_uri", String(redirectUrl));
341-
authorizationUrl.searchParams.set("resource", String(resourceServerUrl));
341+
authorizationUrl.searchParams.set("resource", String(new URL("/", resourceServerUrl)));
342342

343343
return { authorizationUrl, codeVerifier };
344344
}

0 commit comments

Comments
 (0)