From bf78fe0fc14652b6ff927dbbf205f7601a767145 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Tue, 8 Oct 2024 09:39:57 -0400 Subject: [PATCH] fix(elements): Remove example mode guard from passkey event in verification flow (#4295) --- .changeset/little-adults-end.md | 5 +++++ .../src/internals/machines/sign-in/verification.machine.ts | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .changeset/little-adults-end.md diff --git a/.changeset/little-adults-end.md b/.changeset/little-adults-end.md new file mode 100644 index 0000000000..01e109f7e0 --- /dev/null +++ b/.changeset/little-adults-end.md @@ -0,0 +1,5 @@ +--- +"@clerk/elements": patch +--- + +Remove "example mode" guard form "AUTHENICTATE.PASSKEY" event in verification flow diff --git a/packages/elements/src/internals/machines/sign-in/verification.machine.ts b/packages/elements/src/internals/machines/sign-in/verification.machine.ts index 0ae248f3c3..eeedd8c2de 100644 --- a/packages/elements/src/internals/machines/sign-in/verification.machine.ts +++ b/packages/elements/src/internals/machines/sign-in/verification.machine.ts @@ -14,7 +14,7 @@ import type { Web3Attempt, } from '@clerk/types'; import type { DoneActorEvent } from 'xstate'; -import { assign, fromPromise, log, not, sendTo, setup } from 'xstate'; +import { assign, fromPromise, log, sendTo, setup } from 'xstate'; import { MAGIC_LINK_VERIFY_PATH_ROUTE, @@ -270,7 +270,6 @@ const SignInVerificationMachine = setup({ description: 'Waiting for user input', on: { 'AUTHENTICATE.PASSKEY': { - guard: not('isExampleMode'), target: 'AttemptingPasskey', reenter: true, }, @@ -411,7 +410,7 @@ export const SignInFirstFactorMachine = SignInVerificationMachine.provide({ // prepareFirstFactor, we need to assert that the input is a PrepareFirstFactor. For some reason, ESLint thinks // the assertion is unnecessary, and will remove it during the pre-commit hook. To prevent that, we disable the // rule for the line. - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const { params, parent, resendable } = input as PrepareFirstFactorInput; const clerk = parent.getSnapshot().context.clerk;