From 0b123acdac3e749fd972e6b5aa9047fdf0d23e87 Mon Sep 17 00:00:00 2001 From: 2underscores Date: Tue, 12 Aug 2025 09:20:28 +1000 Subject: [PATCH] Static client attempt before DCR --- client/src/lib/oauth-state-machine.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/client/src/lib/oauth-state-machine.ts b/client/src/lib/oauth-state-machine.ts index b110e148..49a77530 100644 --- a/client/src/lib/oauth-state-machine.ts +++ b/client/src/lib/oauth-state-machine.ts @@ -88,20 +88,14 @@ export const oauthTransitions: Record = { clientMetadata.scope = scopesSupported.join(" "); } - // Try DCR first, with static client as fallback - let fullInformation; - try { + // Try Static client first, with DCR as fallback + let fullInformation = await context.provider.clientInformation(); + if (!fullInformation) { fullInformation = await registerClient(context.serverUrl, { metadata, clientMetadata, }); context.provider.saveClientInformation(fullInformation); - } catch (dcrError) { - // DCR failed, fallback to preregistered client - fullInformation = await context.provider.clientInformation(); - if (!fullInformation) { - throw dcrError; - } } context.updateState({