Skip to content

Commit 0e417a1

Browse files
committed
fix errors by running prettier
1 parent fa38a04 commit 0e417a1

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

packages/auth/demo/src/index.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1155,16 +1155,15 @@ function onSelectMultiFactorHint(index) {
11551155
// Clear all input.
11561156
$('#multi-factor-sign-in-verification-id').val('');
11571157
$('#multi-factor-sign-in-verification-code').val('');
1158-
} else if(multiFactorErrorResolver.hints[index].factorId === 'totp'){
1158+
} else if (multiFactorErrorResolver.hints[index].factorId === 'totp') {
11591159
// Save selected second factor.
11601160
selectedMultiFactorHint = multiFactorErrorResolver.hints[index];
1161-
1161+
11621162
// Show sign-in with totp second factor menu.
11631163
$('#multi-factor-totp').removeClass('hidden');
11641164
// Clear all input.
11651165
$('#multi-factor-totp-sign-in-verification-code').val('');
1166-
}
1167-
else {
1166+
} else {
11681167
// 2nd factor not found or not supported by app.
11691168
alertError('Selected 2nd factor is not supported!');
11701169
}
@@ -1222,19 +1221,22 @@ function onFinalizeSignInWithPhoneMultiFactor(event) {
12221221
* Completes sign-in with the 2nd factor totp assertion.
12231222
* @param {!jQuery.Event} event The jQuery event object.
12241223
*/
1225-
function onFinalizeSignInWithTotpMultiFactor(event){
1224+
function onFinalizeSignInWithTotpMultiFactor(event) {
12261225
event.preventDefault();
12271226
// 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();
12291228
if (!otp || !selectedMultiFactorHint || !multiFactorErrorResolver) {
12301229
return;
12311230
}
1232-
1233-
const assertion = TotpMultiFactorGenerator.assertionForSignIn(selectedMultiFactorHint.uid, otp)
1231+
1232+
const assertion = TotpMultiFactorGenerator.assertionForSignIn(
1233+
selectedMultiFactorHint.uid,
1234+
otp
1235+
);
12341236
multiFactorErrorResolver.resolveSignIn(assertion).then(userCredential => {
12351237
onAuthUserCredentialSuccess(userCredential);
12361238
$('#multiFactorModal').modal('hide');
1237-
}, onAuthError)
1239+
}, onAuthError);
12381240
}
12391241

12401242
/**
@@ -2015,13 +2017,11 @@ function initApp() {
20152017
onFinalizeSignInWithPhoneMultiFactor
20162018
);
20172019

2018-
20192020
// Completes multi-factor sign-in with supplied SMS code.
20202021
$('#sign-in-with-totp-multi-factor').click(
20212022
onFinalizeSignInWithTotpMultiFactor
20222023
);
20232024

2024-
20252025
// Starts multi-factor enrollment with phone number.
20262026
$('#enroll-mfa-verify-phone-number').click(onStartEnrollWithPhoneMultiFactor);
20272027
// Completes multi-factor enrollment with supplied SMS code.

packages/auth/src/api/authentication/mfa.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export interface StartTotpMfaSignInRequest {
6060
tenantId?: string;
6161
}
6262

63-
6463
export interface StartPhoneMfaSignInResponse {
6564
phoneResponseInfo: {
6665
sessionInfo: string;
@@ -111,16 +110,15 @@ export interface FinalizePhoneMfaSignInRequest {
111110

112111
export interface FinalizeTotpMfaSignInRequest {
113112
mfaPendingCredential: string;
114-
totpVerificationInfo: {verificationCode: string}
113+
totpVerificationInfo: { verificationCode: string };
115114
tenantId?: string;
116-
mfaEnrollmentId: string
115+
mfaEnrollmentId: string;
117116
}
118117

119118
export interface FinalizePhoneMfaSignInResponse extends FinalizeMfaResponse {}
120119

121120
export interface FinalizeTotpMfaSignInResponse extends FinalizeMfaResponse {}
122121

123-
124122
export function finalizeSignInPhoneMfa(
125123
auth: Auth,
126124
request: FinalizePhoneMfaSignInRequest
@@ -151,7 +149,6 @@ export function finalizeSignInTotpMfa(
151149
);
152150
}
153151

154-
155152
/**
156153
* @internal
157154
*/

packages/auth/src/mfa/assertions/totp.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import {
2626
StartTotpMfaEnrollmentResponse,
2727
TotpVerificationInfo
2828
} from '../../api/account_management/mfa';
29-
import { FinalizeMfaResponse, finalizeSignInTotpMfa } from '../../api/authentication/mfa';
29+
import {
30+
FinalizeMfaResponse,
31+
finalizeSignInTotpMfa
32+
} from '../../api/authentication/mfa';
3033
import { MultiFactorAssertionImpl } from '../../mfa/mfa_assertion';
3134
import { MultiFactorSessionImpl } from '../mfa_session';
3235
import { AuthErrorCode } from '../../core/errors';
@@ -156,15 +159,15 @@ export class TotpMultiFactorAssertionImpl
156159
/** @internal */
157160
_finalizeSignIn(
158161
auth: AuthInternal,
159-
mfaPendingCredential: string,
162+
mfaPendingCredential: string
160163
): Promise<FinalizeMfaResponse> {
161164
_assert(
162-
typeof this.enrollmentId !== 'undefined'
163-
&& typeof this.otp !== 'undefined',
165+
typeof this.enrollmentId !== 'undefined' &&
166+
typeof this.otp !== 'undefined',
164167
auth,
165168
AuthErrorCode.ARGUMENT_ERROR
166169
);
167-
const totpVerificationInfo = {verificationCode: this.otp};
170+
const totpVerificationInfo = { verificationCode: this.otp };
168171
return finalizeSignInTotpMfa(auth, {
169172
mfaPendingCredential,
170173
mfaEnrollmentId: this.enrollmentId,

0 commit comments

Comments
 (0)