File tree Expand file tree Collapse file tree 4 files changed +20
-5
lines changed
Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @clerk/expo-passkeys ' : patch
3+ ' @clerk/shared ' : patch
4+ ---
5+
6+ Add docs URL to ` passkey_invalid_rpID_or_domain ` error
Original file line number Diff line number Diff line change @@ -94,7 +94,10 @@ export function mapNativeErrorToClerkWebAuthnErrorCode(
9494 }
9595
9696 if ( code === '1002' ) {
97- return new ClerkWebAuthnError ( message , { code : 'passkey_invalid_rpID_or_domain' } ) ;
97+ return new ClerkWebAuthnError ( message , {
98+ code : 'passkey_invalid_rpID_or_domain' ,
99+ docsUrl : 'https://clerk.com/docs/deployments/overview#authentication-across-subdomains' ,
100+ } ) ;
98101 }
99102
100103 if ( code === '1003' || code === 'CreateCredentialInterruptedException' ) {
Original file line number Diff line number Diff line change 1+ import type { ClerkErrorParams } from './clerkError' ;
12import { ClerkRuntimeError } from './clerkRuntimeError' ;
23
34type ClerkWebAuthnErrorCode =
@@ -14,14 +15,16 @@ type ClerkWebAuthnErrorCode =
1415 | 'passkey_registration_cancelled'
1516 | 'passkey_registration_failed' ;
1617
18+ type ClerkWebAuthnErrorOptions = Omit < ClerkErrorParams , 'message' | 'code' > & { code : ClerkWebAuthnErrorCode } ;
19+
1720export class ClerkWebAuthnError extends ClerkRuntimeError {
1821 /**
1922 * A unique code identifying the error, can be used for localization.
2023 */
2124 code : ClerkWebAuthnErrorCode ;
2225
23- constructor ( message : string , { code } : { code : ClerkWebAuthnErrorCode } ) {
24- super ( message , { code } ) ;
25- this . code = code ;
26+ constructor ( message : string , options : ClerkWebAuthnErrorOptions ) {
27+ super ( message , options ) ;
28+ this . code = options . code ;
2629 }
2730}
Original file line number Diff line number Diff line change @@ -118,7 +118,10 @@ function handlePublicKeyError(error: Error): ClerkWebAuthnError | ClerkRuntimeEr
118118 return new ClerkWebAuthnError ( error . message , { code : 'passkey_operation_aborted' } ) ;
119119 }
120120 if ( error . name === 'SecurityError' ) {
121- return new ClerkWebAuthnError ( error . message , { code : 'passkey_invalid_rpID_or_domain' } ) ;
121+ return new ClerkWebAuthnError ( error . message , {
122+ code : 'passkey_invalid_rpID_or_domain' ,
123+ docsUrl : 'https://clerk.com/docs/deployments/overview#authentication-across-subdomains' ,
124+ } ) ;
122125 }
123126 return error ;
124127}
You can’t perform that action at this time.
0 commit comments