* Handles send code button click for second factor sign-in. * @param {!Event} e The send code for sign-in on click event.
(e: Event)
| 412 | * @param {!Event} e The send code for sign-in on click event. |
| 413 | */ |
| 414 | function onSignInSendCode(e: Event) { |
| 415 | e.preventDefault(); |
| 416 | if (isCaptchaOK() && mfaResolver) { |
| 417 | const index = parseInt( |
| 418 | mfaHints.options[mfaHints.selectedIndex].getAttribute('data-val')!, |
| 419 | 10, |
| 420 | ); |
| 421 | const info = mfaResolver.hints[index]; |
| 422 | const provider = new PhoneAuthProvider(auth); |
| 423 | const signInRequest = { |
| 424 | multiFactorHint: info, |
| 425 | session: mfaResolver.session, |
| 426 | }; |
| 427 | provider.verifyPhoneNumber(signInRequest, recaptchaVerifier!).then( |
| 428 | function (verificationId) { |
| 429 | phoneVerificationId = verificationId; |
| 430 | updateMfaDialog(); |
| 431 | }, |
| 432 | function (error) { |
| 433 | updateSignInSendCodeButtonUI(); |
| 434 | displayMfaError(error); |
| 435 | }, |
| 436 | ); |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * Handles verify code button click for second factor sign-in. |
nothing calls this directly
no test coverage detected