diff --git a/src/lib/components/mfaChallengeFormList.svelte b/src/lib/components/mfaChallengeFormList.svelte index bd5489f0b..6a4ff5200 100644 --- a/src/lib/components/mfaChallengeFormList.svelte +++ b/src/lib/components/mfaChallengeFormList.svelte @@ -1,21 +1,31 @@ -{#if challengeType === AuthenticationFactor.Recoverycode} +{#if enabledMainFactors.length === 0} + +{:else if challengeType === AuthenticationFactor.Recoverycode} - Enter below one of the recovery codes you received when enabling MFA for this account. + Enter one of the recovery codes you received when enabling MFA. -{:else} - {#if factors.totp && (challengeType === AuthenticationFactor.Totp || challengeType === null)} - Enter below a 6-digit one-time code generated by your authentication app. - {:else if challengeType === AuthenticationFactor.Email} - A 6-digit verification code was sent to your email, enter it below. - {:else if challengeType === AuthenticationFactor.Phone} - A 6-digit verification code was sent to your phone, enter it below. - {/if} +{:else if challengeType === AuthenticationFactor.Totp} + + Enter a 6-digit one-time code from your authenticator app. + + +{:else if challengeType === AuthenticationFactor.Email} + + A 6-digit verification code was sent to your email. Enter it below. + + +{:else if challengeType === AuthenticationFactor.Phone} + + A 6-digit verification code was sent to your phone. Enter it below. + {/if} -{#if showVerifyButton} + +{#if showVerifyButton && enabledMainFactors.length > 0} {/if} -{#if enabledFactors.length > 1} - or -
- {#if factors.totp} - {#if (challengeType === null || challengeType === AuthenticationFactor.Totp || challengeType === AuthenticationFactor.Recoverycode) && factors.email} + +{#if enabledMainFactors.length > 0} + {@const hasSecondaryOptions = + enabledMainFactors.length > 1 || + (factors.recoveryCode && challengeType !== AuthenticationFactor.Recoverycode) || + (enabledMainFactors.length === 1 && factors.recoveryCode)} + + {#if hasSecondaryOptions} + or +
+ + {#if factors.totp && challengeType !== AuthenticationFactor.Totp} - {:else if (challengeType === AuthenticationFactor.Recoverycode && !factors.email) || challengeType === AuthenticationFactor.Email} - {/if} - {:else} + {#if factors.email && challengeType !== AuthenticationFactor.Email} {/if} + {#if factors.phone && challengeType !== AuthenticationFactor.Phone} {/if} - {/if} - {#if factors.recoveryCode && challengeType !== AuthenticationFactor.Recoverycode} - - {/if} -
+ + {#if factors.recoveryCode && challengeType !== AuthenticationFactor.Recoverycode} + + {/if} +
+ {/if} {/if} diff --git a/src/routes/(console)/account/updateMfa.svelte b/src/routes/(console)/account/updateMfa.svelte index 833486f50..f84d49eba 100644 --- a/src/routes/(console)/account/updateMfa.svelte +++ b/src/routes/(console)/account/updateMfa.svelte @@ -280,6 +280,7 @@ @@ -287,6 +288,7 @@ {/if}