@@ -247,7 +247,7 @@ export default class Wrapper {
247247 return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . recoverAccount ( input ) ;
248248 }
249249
250- static registerCredential ( input : {
250+ static createCredential ( input : {
251251 registrationOptions : Omit < RegistrationOptions , "fetchResponse" | "status" > ;
252252 userContext : any ;
253253 } ) : Promise <
@@ -267,7 +267,7 @@ export default class Wrapper {
267267 error : any ;
268268 }
269269 > {
270- return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . registerCredential ( input ) ;
270+ return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . createCredential ( input ) ;
271271 }
272272
273273 static authenticateCredential ( input : {
@@ -463,7 +463,28 @@ export default class Wrapper {
463463 return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . removeCredential ( input ) ;
464464 }
465465
466- static registerCredential2 ( input : {
466+ static registerCredentialWithUser ( input : {
467+ recipeUserId : string ;
468+ email : string ;
469+ options ?: RecipeFunctionOptions ;
470+ userContext : any ;
471+ } ) : Promise <
472+ | { status : "OK" }
473+ | GeneralErrorResponse
474+ | { status : "REGISTER_CREDENTIAL_NOT_ALLOWED" ; reason : string }
475+ | { status : "INVALID_EMAIL_ERROR" ; err : string }
476+ | { status : "INVALID_CREDENTIALS_ERROR" }
477+ | { status : "OPTIONS_NOT_FOUND_ERROR" }
478+ | { status : "INVALID_OPTIONS_ERROR" }
479+ | { status : "INVALID_AUTHENTICATOR_ERROR" ; reason : string }
480+ | { status : "AUTHENTICATOR_ALREADY_REGISTERED" }
481+ | { status : "FAILED_TO_REGISTER_USER" ; error : any }
482+ | { status : "WEBAUTHN_NOT_SUPPORTED" ; error : any }
483+ > {
484+ return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . registerCredentialWithUser ( input ) ;
485+ }
486+
487+ static registerCredential ( input : {
467488 recipeUserId : string ;
468489 webauthnGeneratedOptionsId : string ;
469490 credential : RegistrationResponseJSON ;
@@ -478,7 +499,7 @@ export default class Wrapper {
478499 | { status : "INVALID_OPTIONS_ERROR" }
479500 | { status : "INVALID_AUTHENTICATOR_ERROR" ; reason : string }
480501 > {
481- return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . registerCredential2 ( input ) ;
502+ return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . registerCredential ( input ) ;
482503 }
483504
484505 static doesBrowserSupportWebAuthn ( input : { userContext : any } ) : Promise <
@@ -506,14 +527,14 @@ const signIn = Wrapper.signIn;
506527const getEmailExists = Wrapper . getEmailExists ;
507528const generateRecoverAccountToken = Wrapper . generateRecoverAccountToken ;
508529const recoverAccount = Wrapper . recoverAccount ;
509- const registerCredential = Wrapper . registerCredential ;
530+ const createCredential = Wrapper . createCredential ;
510531const authenticateCredential = Wrapper . authenticateCredential ;
511532const registerCredentialWithSignUp = Wrapper . registerCredentialWithSignUp ;
512533const authenticateCredentialWithSignIn = Wrapper . authenticateCredentialWithSignIn ;
513534const registerCredentialWithRecoverAccount = Wrapper . registerCredentialWithRecoverAccount ;
514535const listCredentials = Wrapper . listCredentials ;
515536const removeCredential = Wrapper . removeCredential ;
516- const registerCredential2 = Wrapper . registerCredential2 ;
537+ const registerCredential = Wrapper . registerCredential ;
517538const doesBrowserSupportWebAuthn = Wrapper . doesBrowserSupportWebAuthn ;
518539const WebauthnComponentsOverrideProvider = Wrapper . ComponentsOverrideProvider ;
519540
@@ -526,7 +547,7 @@ export {
526547 getEmailExists ,
527548 generateRecoverAccountToken ,
528549 recoverAccount ,
529- registerCredential ,
550+ createCredential ,
530551 authenticateCredential ,
531552 registerCredentialWithSignUp ,
532553 authenticateCredentialWithSignIn ,
@@ -535,5 +556,5 @@ export {
535556 WebauthnComponentsOverrideProvider ,
536557 listCredentials ,
537558 removeCredential ,
538- registerCredential2 ,
559+ registerCredential ,
539560} ;
0 commit comments