in auth/mfa-password.js [284:303]
function onEnrollVerifyCode(e) {
e.preventDefault();
if (firebase.auth().currentUser && phoneVerificationId) {
var code = document.getElementById('enroll-verification-code').value;
var credential = firebase.auth.PhoneAuthProvider.credential(
phoneVerificationId, code);
var multiFactorAssertion =
firebase.auth.PhoneMultiFactorGenerator.assertion(credential);
var displayName = document.getElementById('enroll-display-name').value || undefined;
// Enroll the phone second factor.
firebase.auth().currentUser.multiFactor.enroll(multiFactorAssertion, displayName)
.then(function () {
showAccountDetails(firebase.auth().currentUser);
var enrolledFactors = firebase.auth().currentUser.multiFactor.enrolledFactors;
showEnrolledFactors(enrolledFactors);
clearMfaDialog();
alertMessage('Second factor enrolled!');
}).catch(displayMfaError);
}
}