diff --git a/.changeset/modern-bobcats-love.md b/.changeset/modern-bobcats-love.md new file mode 100644 index 00000000000..39044dd76d7 --- /dev/null +++ b/.changeset/modern-bobcats-love.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Bug Fix: When authenticating with a passkey and user was looked out an error was thrown for accessing an undefined variable diff --git a/packages/clerk-js/src/ui/components/SignIn/shared.ts b/packages/clerk-js/src/ui/components/SignIn/shared.ts index 84810aa0eca..95a27a25031 100644 --- a/packages/clerk-js/src/ui/components/SignIn/shared.ts +++ b/packages/clerk-js/src/ui/components/SignIn/shared.ts @@ -11,7 +11,8 @@ import { handleError } from '../../utils'; function useHandleAuthenticateWithPasskey(onSecondFactor: () => Promise) { const card = useCardState(); - const { setActive } = useClerk(); + // @ts-expect-error -- private method for the time being + const { setActive, __internal_navigateWithError } = useClerk(); const supportEmail = useSupportEmail(); const { navigateAfterSignIn } = useSignInContext(); const { authenticateWithPasskey } = useCoreSignIn(); @@ -48,8 +49,7 @@ function useHandleAuthenticateWithPasskey(onSecondFactor: () => Promise } if (isUserLockedError(err)) { - // @ts-expect-error -- private method for the time being - return clerk.__internal_navigateWithError('..', err.errors[0]); + return __internal_navigateWithError('..', err.errors[0]); } handleError(err, [], card.setError); }