Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/browser/src/utils/handleWebAuthnAuthentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ const handleWebAuthnAuthentication = async (challengeData: string): Promise<stri

default:
throw new ThunderIDRuntimeError(
`Passkey authentication failed: ${error.message}`,
'Passkey authentication failed. Please try again.',
'browser-webauthn-general-error',
'browser',
`WebAuthn authentication failed with error: ${error.name}`,
`WebAuthn authentication failed with error: ${error.name}: ${error.message}`,
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/utils/passkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export const handlePasskeyRegistration = async (challengeData: string): Promise<
if (error instanceof Error) {
// Map specific WebAuthn errors to ThunderIDRuntimeError/friendly messages as needed
throw new ThunderIDRuntimeError(
`Passkey registration failed: ${error.message}`,
'Passkey registration failed. Please try again.',
'browser-webauthn-registration-error',
'browser',
`WebAuthn registration failed with error: ${error.name}`,
`WebAuthn registration failed with error: ${error.name}: ${error.message}`,
);
}

Expand Down Expand Up @@ -182,10 +182,10 @@ export const handlePasskeyAuthentication = async (challengeData: string): Promis

if (error instanceof Error) {
throw new ThunderIDRuntimeError(
`Passkey authentication failed: ${error.message}`,
'Passkey authentication failed. Please try again.',
'browser-webauthn-authentication-error',
'browser',
`WebAuthn authentication failed with error: ${error.name}`,
`WebAuthn authentication failed with error: ${error.name}: ${error.message}`,
);
}

Expand Down
8 changes: 4 additions & 4 deletions packages/vue/src/utils/passkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ export const handlePasskeyRegistration = async (challengeData: string): Promise<

if (error instanceof Error) {
throw new ThunderIDRuntimeError(
`Passkey registration failed: ${error.message}`,
'Passkey registration failed. Please try again.',
'browser-webauthn-registration-error',
'browser',
`WebAuthn registration failed with error: ${error.name}`,
`WebAuthn registration failed with error: ${error.name}: ${error.message}`,
);
}

Expand Down Expand Up @@ -177,10 +177,10 @@ export const handlePasskeyAuthentication = async (challengeData: string): Promis

if (error instanceof Error) {
throw new ThunderIDRuntimeError(
`Passkey authentication failed: ${error.message}`,
'Passkey authentication failed. Please try again.',
'browser-webauthn-authentication-error',
'browser',
`WebAuthn authentication failed with error: ${error.name}`,
`WebAuthn authentication failed with error: ${error.name}: ${error.message}`,
);
}

Expand Down
Loading