@@ -1155,16 +1155,15 @@ function onSelectMultiFactorHint(index) {
1155
1155
// Clear all input.
1156
1156
$ ( '#multi-factor-sign-in-verification-id' ) . val ( '' ) ;
1157
1157
$ ( '#multi-factor-sign-in-verification-code' ) . val ( '' ) ;
1158
- } else if ( multiFactorErrorResolver . hints [ index ] . factorId === 'totp' ) {
1158
+ } else if ( multiFactorErrorResolver . hints [ index ] . factorId === 'totp' ) {
1159
1159
// Save selected second factor.
1160
1160
selectedMultiFactorHint = multiFactorErrorResolver . hints [ index ] ;
1161
-
1161
+
1162
1162
// Show sign-in with totp second factor menu.
1163
1163
$ ( '#multi-factor-totp' ) . removeClass ( 'hidden' ) ;
1164
1164
// Clear all input.
1165
1165
$ ( '#multi-factor-totp-sign-in-verification-code' ) . val ( '' ) ;
1166
- }
1167
- else {
1166
+ } else {
1168
1167
// 2nd factor not found or not supported by app.
1169
1168
alertError ( 'Selected 2nd factor is not supported!' ) ;
1170
1169
}
@@ -1222,19 +1221,22 @@ function onFinalizeSignInWithPhoneMultiFactor(event) {
1222
1221
* Completes sign-in with the 2nd factor totp assertion.
1223
1222
* @param {!jQuery.Event } event The jQuery event object.
1224
1223
*/
1225
- function onFinalizeSignInWithTotpMultiFactor ( event ) {
1224
+ function onFinalizeSignInWithTotpMultiFactor ( event ) {
1226
1225
event . preventDefault ( ) ;
1227
1226
// Make sure a second factor is selected.
1228
- const otp = $ ( '#multi-factor-totp-sign-in-verification-code' ) . val ( ) ;
1227
+ const otp = $ ( '#multi-factor-totp-sign-in-verification-code' ) . val ( ) ;
1229
1228
if ( ! otp || ! selectedMultiFactorHint || ! multiFactorErrorResolver ) {
1230
1229
return ;
1231
1230
}
1232
-
1233
- const assertion = TotpMultiFactorGenerator . assertionForSignIn ( selectedMultiFactorHint . uid , otp )
1231
+
1232
+ const assertion = TotpMultiFactorGenerator . assertionForSignIn (
1233
+ selectedMultiFactorHint . uid ,
1234
+ otp
1235
+ ) ;
1234
1236
multiFactorErrorResolver . resolveSignIn ( assertion ) . then ( userCredential => {
1235
1237
onAuthUserCredentialSuccess ( userCredential ) ;
1236
1238
$ ( '#multiFactorModal' ) . modal ( 'hide' ) ;
1237
- } , onAuthError )
1239
+ } , onAuthError ) ;
1238
1240
}
1239
1241
1240
1242
/**
@@ -2015,13 +2017,11 @@ function initApp() {
2015
2017
onFinalizeSignInWithPhoneMultiFactor
2016
2018
) ;
2017
2019
2018
-
2019
2020
// Completes multi-factor sign-in with supplied SMS code.
2020
2021
$ ( '#sign-in-with-totp-multi-factor' ) . click (
2021
2022
onFinalizeSignInWithTotpMultiFactor
2022
2023
) ;
2023
2024
2024
-
2025
2025
// Starts multi-factor enrollment with phone number.
2026
2026
$ ( '#enroll-mfa-verify-phone-number' ) . click ( onStartEnrollWithPhoneMultiFactor ) ;
2027
2027
// Completes multi-factor enrollment with supplied SMS code.
0 commit comments