diff --git a/src/lib/components/mfaChallengeFormList.svelte b/src/lib/components/mfaChallengeFormList.svelte index 96e77daf2..02f06171a 100644 --- a/src/lib/components/mfaChallengeFormList.svelte +++ b/src/lib/components/mfaChallengeFormList.svelte @@ -6,7 +6,12 @@ AuthenticationFactor.Totp ); } - await sdk.forConsole.account.updateMfaChallenge(challenge.$id, code); + + if (code = 'webauthn') { + await sdk.forConsole.webauthnAccount.createMfaWebauthnChallengeHelper(); + } else { + await sdk.forConsole.account.updateMfaChallenge(challenge.$id, code); + } await invalidate(Dependencies.ACCOUNT); trackEvent(Submit.AccountCreate); } catch (error) { @@ -53,6 +58,9 @@ createChallenge(AuthenticationFactor.Phone); } else if (factors.email) { createChallenge(AuthenticationFactor.Email); + } else if (factors.webauthn) { + code = 'webauthn'; + showVerifyButton = false; } } }); @@ -65,14 +73,68 @@
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 !factors.webauthn} + {#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} +Insert your security key into your device and press authenticate.
+Please authenticate with your Webauthn Device to continue.
+