@@ -905,6 +905,26 @@ class SignUpFuture implements SignUpFutureResource {
905905 } ) ;
906906 }
907907
908+ async sendPhoneCode ( params : SignUpFuturePhoneCodeSendParams ) : Promise < { error : ClerkError | null } > {
909+ const { channel = 'sms' } = params ;
910+ return runAsyncResourceTask ( this . #resource, async ( ) => {
911+ await this . #resource. __internal_basePost ( {
912+ body : { strategy : 'phone_code' , channel } ,
913+ action : 'prepare_verification' ,
914+ } ) ;
915+ } ) ;
916+ }
917+
918+ async verifyPhoneCode ( params : SignUpFuturePhoneCodeVerifyParams ) : Promise < { error : ClerkError | null } > {
919+ const { code } = params ;
920+ return runAsyncResourceTask ( this . #resource, async ( ) => {
921+ await this . #resource. __internal_basePost ( {
922+ body : { strategy : 'phone_code' , code } ,
923+ action : 'attempt_verification' ,
924+ } ) ;
925+ } ) ;
926+ }
927+
908928 async sendEmailLink ( params : SignUpFutureEmailLinkSendParams ) : Promise < { error : ClerkError | null } > {
909929 const { verificationUrl } = params ;
910930 return runAsyncResourceTask ( this . #resource, async ( ) => {
@@ -945,34 +965,6 @@ class SignUpFuture implements SignUpFutureResource {
945965 } ) ;
946966 }
947967
948- async sendPhoneCode ( params : SignUpFuturePhoneCodeSendParams ) : Promise < { error : ClerkError | null } > {
949- const { phoneNumber, channel = 'sms' } = params ;
950- return runAsyncResourceTask ( this . #resource, async ( ) => {
951- if ( ! this . #resource. id ) {
952- const { captchaToken, captchaWidgetType, captchaError } = await this . getCaptchaToken ( ) ;
953- await this . #resource. __internal_basePost ( {
954- path : this . #resource. pathRoot ,
955- body : { phoneNumber, captchaToken, captchaWidgetType, captchaError } ,
956- } ) ;
957- }
958-
959- await this . #resource. __internal_basePost ( {
960- body : { strategy : 'phone_code' , channel } ,
961- action : 'prepare_verification' ,
962- } ) ;
963- } ) ;
964- }
965-
966- async verifyPhoneCode ( params : SignUpFuturePhoneCodeVerifyParams ) : Promise < { error : ClerkError | null } > {
967- const { code } = params ;
968- return runAsyncResourceTask ( this . #resource, async ( ) => {
969- await this . #resource. __internal_basePost ( {
970- body : { strategy : 'phone_code' , code } ,
971- action : 'attempt_verification' ,
972- } ) ;
973- } ) ;
974- }
975-
976968 async sso ( params : SignUpFutureSSOParams ) : Promise < { error : ClerkError | null } > {
977969 const {
978970 strategy,
0 commit comments