Static client attempt before DCR
This commit is contained in:
parent
37f634d651
commit
0b123acdac
1 changed files with 3 additions and 9 deletions
|
|
@ -88,20 +88,14 @@ export const oauthTransitions: Record<OAuthStep, StateTransition> = {
|
|||
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({
|
||||
|
|
|
|||
Loading…
Reference in a new issue