MCPcopy Index your code
hub / github.com/firebase/quickstart-js / onSignInSendCode

Function onSignInSendCode

auth/mfa-password.ts:414–438  ·  view source on GitHub ↗

* Handles send code button click for second factor sign-in. * @param {!Event} e The send code for sign-in on click event.

(e: Event)

Source from the content-addressed store, hash-verified

412 * @param {!Event} e The send code for sign-in on click event.
413 */
414function 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.

Callers

nothing calls this directly

Calls 4

updateMfaDialogFunction · 0.85
displayMfaErrorFunction · 0.85
isCaptchaOKFunction · 0.70

Tested by

no test coverage detected