Skip to content

Commit 0b123ac

Browse files
committed
Static client attempt before DCR
1 parent 37f634d commit 0b123ac

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,14 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
8888
clientMetadata.scope = scopesSupported.join(" ");
8989
}
9090

91-
// Try DCR first, with static client as fallback
92-
let fullInformation;
93-
try {
91+
// Try Static client first, with DCR as fallback
92+
let fullInformation = await context.provider.clientInformation();
93+
if (!fullInformation) {
9494
fullInformation = await registerClient(context.serverUrl, {
9595
metadata,
9696
clientMetadata,
9797
});
9898
context.provider.saveClientInformation(fullInformation);
99-
} catch (dcrError) {
100-
// DCR failed, fallback to preregistered client
101-
fullInformation = await context.provider.clientInformation();
102-
if (!fullInformation) {
103-
throw dcrError;
104-
}
10599
}
106100

107101
context.updateState({

0 commit comments

Comments
 (0)