Skip to content

Commit c8b0e15

Browse files
committed
Fixes
1 parent 3de3868 commit c8b0e15

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

packages-exp/auth-exp/src/mfa/mfa_resolver.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@ import { expect, use } from 'chai';
1919
import * as chaiAsPromised from 'chai-as-promised';
2020
import * as sinon from 'sinon';
2121

22-
import { OperationType, ProviderId } from '@firebase/auth-types-exp';
22+
import { FactorId, OperationType, ProviderId } from '@firebase/auth-types-exp';
2323
import { FirebaseError } from '@firebase/util';
2424

2525
import { mockEndpoint } from '../../test/helpers/api/helper';
2626
import { testAuth, testUser, TestAuth } from '../../test/helpers/mock_auth';
2727
import * as mockFetch from '../../test/helpers/mock_fetch';
2828
import { Endpoint } from '../api';
2929
import { APIUserInfo } from '../api/account_management/account';
30-
import { AuthCredential } from '../core/credentials';
3130
import { PhoneAuthCredential } from '../core/credentials/phone';
3231
import { AuthErrorCode } from '../core/errors';
33-
import { EmailAuthProvider } from '../core/providers/email';
3432
import { User, UserCredential } from '../model/user';
3533
import { MultiFactorAssertion } from './mfa_assertion';
3634
import { PhoneMultiFactorAssertion } from '../platform_browser/mfa/assertions/phone';
@@ -45,17 +43,12 @@ describe('core/mfa/mfa_resolver/MultiFactorResolver', () => {
4543
let auth: TestAuth;
4644
let underlyingError: FirebaseError;
4745
let error: MultiFactorError;
48-
let primaryFactorCredential: AuthCredential;
4946
let clock: sinon.SinonFakeTimers;
5047

5148
beforeEach(async () => {
5249
clock = sinon.useFakeTimers();
5350
auth = await testAuth();
5451
auth.tenantId = 'tenant-id';
55-
primaryFactorCredential = EmailAuthProvider.credential(
56-
'email',
57-
'password'
58-
) as AuthCredential;
5952
underlyingError = _createError(auth, AuthErrorCode.MFA_REQUIRED, {
6053
serverResponse: {
6154
localId: 'local-id',
@@ -233,7 +226,7 @@ describe('core/mfa/mfa_resolver/MultiFactorResolver', () => {
233226

234227
it('can be used to obtain a resolver', () => {
235228
const resolver = getMultiFactorResolver(auth, error);
236-
expect(resolver.hints[0].factorId).to.eq(ProviderId.PHONE);
229+
expect(resolver.hints[0].factorId).to.eq(FactorId.PHONE);
237230
});
238231
});
239232
});

packages-exp/auth-exp/src/mfa/mfa_resolver.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ export function getMultiFactorResolver(
119119
): externs.MultiFactorResolver {
120120
const errorInternal = error as MultiFactorError;
121121
_assert(error.operationType, auth, AuthErrorCode.ARGUMENT_ERROR);
122-
_assert(error.credential, auth, AuthErrorCode.ARGUMENT_ERROR);
123122
_assert(
124123
errorInternal.serverResponse?.mfaPendingCredential,
125124
auth,

0 commit comments

Comments
 (0)