* Handles verify code button click for second factor sign-in. * @param {!Event} e The verify code for sign-in on click event.
(e: Event)
| 442 | * @param {!Event} e The verify code for sign-in on click event. |
| 443 | */ |
| 444 | function onSignInVerifyCode(e: Event) { |
| 445 | e.preventDefault(); |
| 446 | if (mfaResolver && phoneVerificationId) { |
| 447 | const signInVerificationCodeInput = document.getElementById( |
| 448 | 'sign-in-verification-code', |
| 449 | )! as HTMLInputElement; |
| 450 | const code = signInVerificationCodeInput.value; |
| 451 | const credential = PhoneAuthProvider.credential(phoneVerificationId, code); |
| 452 | const multiFactorAssertion = |
| 453 | PhoneMultiFactorGenerator.assertion(credential); |
| 454 | mfaResolver |
| 455 | .resolveSignIn(multiFactorAssertion) |
| 456 | .then(function () { |
| 457 | alertMessage('Signed in with second factor!'); |
| 458 | clearMfaDialog(); |
| 459 | const enrolledFactors = multiFactor(auth.currentUser!).enrolledFactors; |
| 460 | showEnrolledFactors(enrolledFactors); |
| 461 | }) |
| 462 | .catch(displayMfaError); |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * Handles unenroll icon click for enrolled second factors. |
nothing calls this directly
no test coverage detected