* Updates the multi-factor dialog UI for enrollment/sign-in flows.
()
| 182 | * Updates the multi-factor dialog UI for enrollment/sign-in flows. |
| 183 | */ |
| 184 | function 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. |
no test coverage detected