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

Function onVerifyCodeSubmit

auth/phone-visible.ts:103–132  ·  view source on GitHub ↗

* Function called when clicking the "Verify Code" button.

(e: Event)

Source from the content-addressed store, hash-verified

101 * Function called when clicking the "Verify Code" button.
102 */
103function onVerifyCodeSubmit(e: Event) {
104 e.preventDefault();
105 if (!!getCodeFromUserInput()) {
106 window.verifyingCode = true;
107 updateVerifyCodeButtonUI();
108 const code = getCodeFromUserInput();
109 window
110 .confirmationResult!.confirm(code)
111 .then(function (result) {
112 // User signed in successfully.
113 const user = result.user;
114 window.verifyingCode = false;
115 window.confirmationResult = null;
116 updateVerificationCodeFormUI();
117 })
118 .catch(function (error) {
119 // User couldn't sign in (bad verification code?)
120 console.error('Error while checking the verification code', error);
121 window.alert(
122 'Error while checking the verification code:\n\n' +
123 error.code +
124 '\n\n' +
125 error.message,
126 );
127 window.verifyingCode = false;
128 updateSignInButtonUI();
129 updateVerifyCodeButtonUI();
130 });
131 }
132}
133
134/**
135 * Cancels the verification code input.

Callers

nothing calls this directly

Calls 4

getCodeFromUserInputFunction · 0.70
updateVerifyCodeButtonUIFunction · 0.70
updateSignInButtonUIFunction · 0.70

Tested by

no test coverage detected