diff --git a/lib/idx/remediate.ts b/lib/idx/remediate.ts index 6cf698621..140420c91 100644 --- a/lib/idx/remediate.ts +++ b/lib/idx/remediate.ts @@ -150,8 +150,9 @@ export async function remediate( `); } - // Return next step to the caller - if (!remediator.canRemediate()) { + // always attempt remediation if `opts.step` is provided + if (!options.step && !remediator.canRemediate()) { + // Return next step to the caller const nextStep = getNextStep(authClient, remediator, idxResponse); return { idxResponse, diff --git a/lib/idx/remediators/Base/SelectAuthenticator.ts b/lib/idx/remediators/Base/SelectAuthenticator.ts index ffc0b06df..9be2f796e 100644 --- a/lib/idx/remediators/Base/SelectAuthenticator.ts +++ b/lib/idx/remediators/Base/SelectAuthenticator.ts @@ -89,11 +89,13 @@ export class SelectAuthenticator name === 'id').value - }; + if (selectedOption) { + this.selectedAuthenticator = selectedOption.relatesTo; // track the selected authenticator + this.selectedOption = selectedOption; + return { + id: selectedOption?.value.form.value.find(({ name }) => name === 'id').value + }; + } } getInputAuthenticator(remediation) { diff --git a/lib/idx/remediators/SelectAuthenticatorUnlockAccount.ts b/lib/idx/remediators/SelectAuthenticatorUnlockAccount.ts index b500e574c..1d9761c60 100644 --- a/lib/idx/remediators/SelectAuthenticatorUnlockAccount.ts +++ b/lib/idx/remediators/SelectAuthenticatorUnlockAccount.ts @@ -38,11 +38,16 @@ export class SelectAuthenticatorUnlockAccount extends SelectAuthenticator