|
17 | 17 |
|
18 | 18 | import * as externs from '@firebase/auth-types-exp';
|
19 | 19 |
|
20 |
| -import { |
21 |
| - signInWithIdp, |
22 |
| - SignInWithIdpRequest |
23 |
| -} from '../../api/authentication/idp'; |
| 20 | +import { signInWithIdp, SignInWithIdpRequest } from '../../api/authentication/idp'; |
| 21 | +import { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa'; |
24 | 22 | import { Auth } from '../../model/auth';
|
| 23 | +import { IdTokenResponse } from '../../model/id_token'; |
25 | 24 | import { User, UserCredential } from '../../model/user';
|
| 25 | +import { AuthCredential } from '../credentials'; |
26 | 26 | import { _link as _linkUser } from '../user/link_unlink';
|
27 | 27 | import { _reauthenticate } from '../user/reauthenticate';
|
28 | 28 | import { assert, debugFail } from '../util/assert';
|
29 | 29 | import { signInWithCredential } from './credential';
|
30 |
| -import { AuthCredential } from '../credentials'; |
31 |
| -import { IdTokenResponse } from '../../model/id_token'; |
32 |
| -import { PhoneOrOauthTokenResponse } from '../../api/authentication/mfa'; |
33 | 30 |
|
34 | 31 | export interface IdpTaskParams {
|
35 | 32 | auth: Auth;
|
@@ -92,21 +89,21 @@ class IdpCredential implements AuthCredential {
|
92 | 89 |
|
93 | 90 | export function _signIn(
|
94 | 91 | params: IdpTaskParams
|
95 |
| -): Promise<externs.UserCredential> { |
96 |
| - return signInWithCredential(params.auth, new IdpCredential(params)); |
| 92 | +): Promise<UserCredential> { |
| 93 | + return signInWithCredential(params.auth, new IdpCredential(params)) as Promise<UserCredential>; |
97 | 94 | }
|
98 | 95 |
|
99 | 96 | export function _reauth(
|
100 | 97 | params: IdpTaskParams
|
101 |
| -): Promise<externs.UserCredential> { |
| 98 | +): Promise<UserCredential> { |
102 | 99 | const { auth, user } = params;
|
103 | 100 | assert(user, auth.name);
|
104 | 101 | return _reauthenticate(user, new IdpCredential(params));
|
105 | 102 | }
|
106 | 103 |
|
107 | 104 | export async function _link(
|
108 | 105 | params: IdpTaskParams
|
109 |
| -): Promise<externs.UserCredential> { |
| 106 | +): Promise<UserCredential> { |
110 | 107 | const { auth, user } = params;
|
111 | 108 | assert(user, auth.name);
|
112 | 109 | return _linkUser(user, new IdpCredential(params));
|
|
0 commit comments