File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -186,14 +186,11 @@ function Login(props: LoginProps) {
186186 authBuildEnv,
187187 } ) ;
188188
189- let token = "" ;
190- if ( authConnection === AUTH_CONNECTION . SMS_PASSWORDLESS ) {
191- const res = await captchaRef . current ?. execute ( { async : true } ) ;
192- if ( ! res ) {
193- throw WalletLoginError . connectionError ( "Captcha token is required" ) ;
194- }
195- token = res . response ;
189+ const res = await captchaRef . current ?. execute ( { async : true } ) ;
190+ if ( ! res ) {
191+ throw WalletLoginError . connectionError ( "Captcha token is required" ) ;
196192 }
193+ const token = res . response ;
197194
198195 const result = await handler . sendVerificationCode ( { captchaToken : token } ) ;
199196 if ( result ?. error ) {
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ export abstract class PasswordlessHandler {
120120 } ;
121121 }
122122
123- abstract sendVerificationCode ( params ? : { captchaToken : string } ) : Promise < IStartResponse > ;
123+ abstract sendVerificationCode ( params : { captchaToken : string } ) : Promise < IStartResponse > ;
124124
125125 abstract verifyCode ( code : string ) : Promise < IVerifyResponse > ;
126126}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default class EmailPasswordlessHandler extends PasswordlessHandler {
1414 if ( this . sessionStorageAvailable ) this . trackingId = window . sessionStorage . getItem ( "trackingId" ) ?? undefined ;
1515 }
1616
17- async sendVerificationCode ( ) {
17+ async sendVerificationCode ( { captchaToken } : { captchaToken ?: string } ) {
1818 const { loginHint, network, web3authClientId } = this . passwordlessParams ;
1919
2020 const finalParams : CodeInitiateRequestBodyParams = {
@@ -27,6 +27,7 @@ export default class EmailPasswordlessHandler extends PasswordlessHandler {
2727 version : "" ,
2828 network,
2929 flow_type : EMAIL_FLOW . code ,
30+ captcha_token : captchaToken ,
3031 } ;
3132
3233 return super . start ( finalParams ) ;
You can’t perform that action at this time.
0 commit comments