Skip to content

Commit 1fd5434

Browse files
sam-gcavolkovi
authored andcommitted
Remove circular dependency issue with AuthCredential (#3718)
* Fix circular dependency issue * Formatting
1 parent 455deb2 commit 1fd5434

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

packages-exp/auth-exp/src/core/credentials/auth_credential.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa';
1919
import { AuthCore } from '../../model/auth';
2020
import { IdTokenResponse } from '../../model/id_token';
21-
import { EmailAuthCredential, OAuthCredential, PhoneAuthCredential } from './';
2221
import { debugFail } from '../util/assert';
2322

2423
export class AuthCredential {
@@ -27,21 +26,6 @@ export class AuthCredential {
2726
readonly signInMethod: string
2827
) {}
2928

30-
static fromJSON(json: object | string): AuthCredential | null {
31-
for (const fn of [
32-
/* SAMLAuthCredential.fromJSON, */
33-
OAuthCredential.fromJSON,
34-
EmailAuthCredential.fromJSON,
35-
PhoneAuthCredential.fromJSON
36-
]) {
37-
const credential = fn(json);
38-
if (credential) {
39-
return credential;
40-
}
41-
}
42-
return null;
43-
}
44-
4529
toJSON(): object {
4630
return debugFail('not implemented');
4731
}

packages-exp/auth-exp/src/core/credentials/email.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { AuthCore } from '../../model/auth';
2727
import { IdTokenResponse } from '../../model/id_token';
2828
import { AuthErrorCode } from '../errors';
2929
import { fail } from '../util/assert';
30-
import { AuthCredential } from './';
30+
import { AuthCredential } from './auth_credential';
3131

3232
export class EmailAuthCredential
3333
extends AuthCredential

packages-exp/auth-exp/src/core/credentials/oauth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import {
2323
SignInWithIdpRequest
2424
} from '../../api/authentication/idp';
2525
import { AuthCore } from '../../model/auth';
26+
import { IdTokenResponse } from '../../model/id_token';
2627
import { AuthErrorCode } from '../errors';
2728
import { fail } from '../util/assert';
28-
import { AuthCredential } from './';
29-
import { IdTokenResponse } from '../../model/id_token';
29+
import { AuthCredential } from './auth_credential';
3030

3131
const IDP_REQUEST_URI = 'http://localhost';
3232

packages-exp/auth-exp/src/core/credentials/phone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
} from '../../api/authentication/sms';
2727
import { AuthCore } from '../../model/auth';
2828
import { IdTokenResponse } from '../../model/id_token';
29-
import { AuthCredential } from './';
29+
import { AuthCredential } from './auth_credential';
3030

3131
export interface PhoneAuthCredentialParameters {
3232
verificationId?: string;

0 commit comments

Comments
 (0)