From 40e5e537d376dd65cb13ce4db7ab72b8c655e1a9 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sun, 20 Sep 2026 10:37:24 +0000 Subject: [PATCH] fix(passkey): Prevent Sentry exception on iOS passkey cancellation --- hooks/useUser.ts | 2 +- lib/utils/__tests__/passkey-credentials.test.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/useUser.ts b/hooks/useUser.ts index 6106f2e0f..c27105ac2 100644 --- a/hooks/useUser.ts +++ b/hooks/useUser.ts @@ -431,7 +431,7 @@ const useUser = (): UseUserReturn => { ? 'User not found, please sign up' : error?.message || 'Network request timed out'; - if (error?.name === 'NotAllowedError') { + if (error?.name === 'NotAllowedError' || isPasskeyPromptError(error)) { errorMessage = 'User cancelled login'; Sentry.captureMessage(errorMessage, { level: 'warning', diff --git a/lib/utils/__tests__/passkey-credentials.test.ts b/lib/utils/__tests__/passkey-credentials.test.ts index 31c9f5a67..fcbb1416f 100644 --- a/lib/utils/__tests__/passkey-credentials.test.ts +++ b/lib/utils/__tests__/passkey-credentials.test.ts @@ -59,6 +59,7 @@ describe('mergeCredentialIds', () => { describe('isPasskeyPromptError', () => { it.each([ ['iOS cancellation', { message: 'The user cancelled the request.' }], + ['Turnkey UserCancelled', { error: 'UserCancelled', message: 'The user cancelled the request.' }], ['Android Credential Manager', { message: '[16] Cancelled by user.' }], ['WebAuthn DOMException', { name: 'NotAllowedError', message: 'not allowed' }], ['aborted ceremony', { name: 'AbortError', message: 'aborted' }],