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

Function updateMfaDialog

auth/mfa-password.ts:184–220  ·  view source on GitHub ↗

* Updates the multi-factor dialog UI for enrollment/sign-in flows.

()

Source from the content-addressed store, hash-verified

182 * Updates the multi-factor dialog UI for enrollment/sign-in flows.
183 */
184function updateMfaDialog() {
185 hideElement('mfa-error-message');
186 // For multi-factor sign-in.
187 if (mfaResolver) {
188 showElement('mfa-sign-in-modal');
189 hideElement('mfa-enroll-modal');
190 if (phoneVerificationId) {
191 // Display verify code form.
192 clearAppVerifier();
193 hideElement('sign-in-send-code-form');
194 showElement('sign-in-verification-code-form');
195 } else {
196 // Display send code form.
197 updateMfaSignInHints(mfaResolver.hints);
198 showElement('sign-in-send-code-form');
199 hideElement('sign-in-verification-code-form');
200 renderRecaptcha('sign-in-recaptcha-container');
201 updateSignInSendCodeButtonUI();
202 }
203 // For multi-factor enrollment.
204 } else {
205 hideElement('mfa-sign-in-modal');
206 showElement('mfa-enroll-modal');
207 if (phoneVerificationId) {
208 // Display verify code form.
209 clearAppVerifier();
210 hideElement('enroll-send-code-form');
211 showElement('enroll-verification-code-form');
212 } else {
213 // Display send code form.
214 showElement('enroll-send-code-form');
215 hideElement('enroll-verification-code-form');
216 renderRecaptcha('enroll-recaptcha-container');
217 updateEnrollSendCodeButtonUI();
218 }
219 }
220}
221
222/**
223 * Handles the enroll button click.

Callers 3

showMfaDialogFunction · 0.85
onEnrollSendCodeFunction · 0.85
onSignInSendCodeFunction · 0.85

Calls 7

hideElementFunction · 0.85
showElementFunction · 0.85
clearAppVerifierFunction · 0.85
updateMfaSignInHintsFunction · 0.85
renderRecaptchaFunction · 0.85

Tested by

no test coverage detected