Skip to content

Commit e2d3989

Browse files
committed
use scopes from PRM if available
1 parent 9371006 commit e2d3989

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

client/src/lib/oauth-state-machine.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,13 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
7272
const metadata = context.state.oauthMetadata!;
7373
const clientMetadata = context.provider.clientMetadata;
7474

75+
// Prefer scopes from resource metadata if available
76+
const scopesSupported =
77+
context.state.resourceMetadata?.scopes_supported ||
78+
metadata.scopes_supported;
7579
// Add all supported scopes to client registration
76-
if (metadata.scopes_supported) {
77-
clientMetadata.scope = metadata.scopes_supported.join(" ");
80+
if (scopesSupported) {
81+
clientMetadata.scope = scopesSupported.join(" ");
7882
}
7983

8084
const fullInformation = await registerClient(context.serverUrl, {

0 commit comments

Comments
 (0)