Skip to content

Commit

Permalink
fix(clerk-js): Correctly call __internal_navigateWithError when authe…
Browse files Browse the repository at this point in the history
…nticating with passkey (#3172)

* fix(clerk-js): Correctly call `__internal_navigateWithError` when authenticating with passkey

* chore(clerk-js): Add changeset
  • Loading branch information
panteliselef authored Apr 11, 2024
1 parent af73213 commit 4aff3d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-bobcats-love.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions packages/clerk-js/src/ui/components/SignIn/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { handleError } from '../../utils';

function useHandleAuthenticateWithPasskey(onSecondFactor: () => Promise<unknown>) {
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();
Expand Down Expand Up @@ -48,8 +49,7 @@ function useHandleAuthenticateWithPasskey(onSecondFactor: () => Promise<unknown>
}

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);
}
Expand Down

0 comments on commit 4aff3d9

Please sign in to comment.