@firebase/auth 0.19.3 → 0.19.4-canary.a185b1431

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/auth-public.d.ts +1 -2
  3. package/dist/auth.d.ts +2 -3
  4. package/dist/cordova/index.js +2 -2
  5. package/dist/cordova/internal.js +9 -3
  6. package/dist/cordova/internal.js.map +1 -1
  7. package/dist/cordova/{popup_redirect-1cde31c6.js → popup_redirect-cf1fe24c.js} +82 -48
  8. package/dist/cordova/popup_redirect-cf1fe24c.js.map +1 -0
  9. package/dist/cordova/src/api/index.d.ts +2 -1
  10. package/dist/cordova/src/core/auth/auth_impl.d.ts +1 -1
  11. package/dist/cordova/src/model/auth.d.ts +1 -1
  12. package/dist/cordova/src/model/public_types.d.ts +1 -2
  13. package/dist/esm2017/{index-8593558d.js → index-e0ba4728.js} +30 -16
  14. package/dist/esm2017/index-e0ba4728.js.map +1 -0
  15. package/dist/esm2017/index.js +1 -1
  16. package/dist/esm2017/internal.js +2 -2
  17. package/dist/esm2017/src/api/index.d.ts +2 -1
  18. package/dist/esm2017/src/core/auth/auth_impl.d.ts +1 -1
  19. package/dist/esm2017/src/model/auth.d.ts +1 -1
  20. package/dist/esm2017/src/model/public_types.d.ts +1 -2
  21. package/dist/esm5/{index-4f7e1a18.js → index-c216c700.js} +89 -49
  22. package/dist/esm5/index-c216c700.js.map +1 -0
  23. package/dist/esm5/index.js +1 -1
  24. package/dist/esm5/internal.js +2 -2
  25. package/dist/esm5/src/api/index.d.ts +2 -1
  26. package/dist/esm5/src/core/auth/auth_impl.d.ts +1 -1
  27. package/dist/esm5/src/model/auth.d.ts +1 -1
  28. package/dist/esm5/src/model/public_types.d.ts +1 -2
  29. package/dist/index.webworker.esm5.js +81 -47
  30. package/dist/index.webworker.esm5.js.map +1 -1
  31. package/dist/node/{index-057dcc31.js → index-0ffb6e81.js} +82 -48
  32. package/dist/node/index-0ffb6e81.js.map +1 -0
  33. package/dist/node/index.js +1 -1
  34. package/dist/node/internal.js +1 -1
  35. package/dist/node/src/api/index.d.ts +2 -1
  36. package/dist/node/src/core/auth/auth_impl.d.ts +1 -1
  37. package/dist/node/src/model/auth.d.ts +1 -1
  38. package/dist/node/src/model/public_types.d.ts +1 -2
  39. package/dist/node-esm/{index-c327074d.js → index-620dc5a9.js} +24 -15
  40. package/dist/node-esm/index-620dc5a9.js.map +1 -0
  41. package/dist/node-esm/index.js +1 -1
  42. package/dist/node-esm/internal.js +2 -2
  43. package/dist/node-esm/src/api/index.d.ts +2 -1
  44. package/dist/node-esm/src/core/auth/auth_impl.d.ts +1 -1
  45. package/dist/node-esm/src/model/auth.d.ts +1 -1
  46. package/dist/node-esm/src/model/public_types.d.ts +1 -2
  47. package/dist/rn/index.js +1 -1
  48. package/dist/rn/internal.js +8 -2
  49. package/dist/rn/internal.js.map +1 -1
  50. package/dist/rn/{phone-4c7624c1.js → phone-bf918508.js} +82 -48
  51. package/dist/rn/phone-bf918508.js.map +1 -0
  52. package/dist/rn/src/api/index.d.ts +2 -1
  53. package/dist/rn/src/core/auth/auth_impl.d.ts +1 -1
  54. package/dist/rn/src/model/auth.d.ts +1 -1
  55. package/dist/rn/src/model/public_types.d.ts +1 -2
  56. package/dist/src/api/index.d.ts +2 -1
  57. package/dist/src/core/auth/auth_impl.d.ts +1 -1
  58. package/dist/src/model/auth.d.ts +1 -1
  59. package/dist/src/model/public_types.d.ts +1 -2
  60. package/package.json +8 -7
  61. package/dist/cordova/popup_redirect-1cde31c6.js.map +0 -1
  62. package/dist/esm2017/index-8593558d.js.map +0 -1
  63. package/dist/esm5/index-4f7e1a18.js.map +0 -1
  64. package/dist/node/index-057dcc31.js.map +0 -1
  65. package/dist/node-esm/index-c327074d.js.map +0 -1
  66. package/dist/rn/phone-4c7624c1.js.map +0 -1
@@ -1,4 +1,4 @@
1
- export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-8593558d.js';
1
+ export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-e0ba4728.js';
2
2
  import '@firebase/util';
3
3
  import '@firebase/app';
4
4
  import 'tslib';
@@ -1,5 +1,5 @@
1
- import { ao as _isIOS7Or8, ap as debugAssert, aq as _isIOS, ar as _isAndroid, as as _fail, at as _getRedirectUrl, au as _getProjectConfig, av as _createError, aw as _assert, ax as _getInstance, b as browserLocalPersistence, ay as _persistenceKeyName, az as AuthEventManager, a as browserSessionPersistence, aA as _getRedirectResult, aB as _clearRedirectOutcomes, aC as _castAuth } from './index-8593558d.js';
2
- export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aE as AuthImpl, aH as AuthPopup, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aI as FetchProvider, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aJ as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aD as UserImpl, aw as _assert, aC as _castAuth, as as _fail, aG as _generateEventId, aF as _getClientVersion, ax as _getInstance, aA as _getRedirectResult, ay as _persistenceKeyName, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-8593558d.js';
1
+ import { ao as _isIOS7Or8, ap as debugAssert, aq as _isIOS, ar as _isAndroid, as as _fail, at as _getRedirectUrl, au as _getProjectConfig, av as _createError, aw as _assert, ax as _getInstance, b as browserLocalPersistence, ay as _persistenceKeyName, az as AuthEventManager, a as browserSessionPersistence, aA as _getRedirectResult, aB as _clearRedirectOutcomes, aC as _castAuth } from './index-e0ba4728.js';
2
+ export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aE as AuthImpl, aH as AuthPopup, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aI as FetchProvider, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aJ as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aD as UserImpl, aw as _assert, aC as _castAuth, as as _fail, aG as _generateEventId, aF as _getClientVersion, ax as _getInstance, aA as _getRedirectResult, ay as _persistenceKeyName, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-e0ba4728.js';
3
3
  import { querystringDecode } from '@firebase/util';
4
4
  import '@firebase/app';
5
5
  import 'tslib';
@@ -27,7 +27,8 @@ export declare const enum HttpMethod {
27
27
  export declare const enum HttpHeader {
28
28
  CONTENT_TYPE = "Content-Type",
29
29
  X_FIREBASE_LOCALE = "X-Firebase-Locale",
30
- X_CLIENT_VERSION = "X-Client-Version"
30
+ X_CLIENT_VERSION = "X-Client-Version",
31
+ X_FIREBASE_GMPID = "X-Firebase-gmpid"
31
32
  }
32
33
  export declare const enum Endpoint {
33
34
  CREATE_AUTH_URI = "/v1/accounts:createAuthUri",
@@ -95,7 +95,7 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
95
95
  private clientVersion;
96
96
  _logFramework(framework: string): void;
97
97
  _getFrameworks(): readonly string[];
98
- _getSdkClientVersion(): string;
98
+ _getAdditionalHeaders(): Promise<Record<string, string>>;
99
99
  }
100
100
  /**
101
101
  * Method to be used to cast down to our private implmentation of Auth.
@@ -63,7 +63,7 @@ export interface AuthInternal extends Auth {
63
63
  _getPersistence(): string;
64
64
  _logFramework(framework: string): void;
65
65
  _getFrameworks(): readonly string[];
66
- _getSdkClientVersion(): string;
66
+ _getAdditionalHeaders(): Promise<Record<string, string>>;
67
67
  readonly name: AppName;
68
68
  readonly config: ConfigInternal;
69
69
  languageCode: string | null;
@@ -934,8 +934,7 @@ export interface User extends UserInfo {
934
934
  toJSON(): object;
935
935
  }
936
936
  /**
937
- * A structure containing a {@link User}, an {@link AuthCredential}, the {@link OperationType},
938
- * and any additional user information that was returned from the identity provider.
937
+ * A structure containing a {@link User}, the {@link OperationType}, and the provider ID.
939
938
  *
940
939
  * @remarks
941
940
  * `operationType` could be {@link OperationType}.SIGN_IN for a sign-in operation,
@@ -941,30 +941,38 @@ function _addTidIfNecessary(auth, request) {
941
941
  function _performApiRequest(auth, method, path, request, customErrorMap) {
942
942
  if (customErrorMap === void 0) { customErrorMap = {}; }
943
943
  return __awaiter(this, void 0, void 0, function () {
944
+ var _this = this;
944
945
  return __generator(this, function (_a) {
945
- return [2 /*return*/, _performFetchWithErrorHandling(auth, customErrorMap, function () {
946
- var body = {};
947
- var params = {};
948
- if (request) {
949
- if (method === "GET" /* GET */) {
950
- params = request;
951
- }
952
- else {
953
- body = {
954
- body: JSON.stringify(request)
955
- };
946
+ return [2 /*return*/, _performFetchWithErrorHandling(auth, customErrorMap, function () { return __awaiter(_this, void 0, void 0, function () {
947
+ var body, params, query, headers;
948
+ return __generator(this, function (_a) {
949
+ switch (_a.label) {
950
+ case 0:
951
+ body = {};
952
+ params = {};
953
+ if (request) {
954
+ if (method === "GET" /* GET */) {
955
+ params = request;
956
+ }
957
+ else {
958
+ body = {
959
+ body: JSON.stringify(request)
960
+ };
961
+ }
962
+ }
963
+ query = querystring(__assign({ key: auth.config.apiKey }, params)).slice(1);
964
+ return [4 /*yield*/, auth._getAdditionalHeaders()];
965
+ case 1:
966
+ headers = _a.sent();
967
+ headers["Content-Type" /* CONTENT_TYPE */] = 'application/json';
968
+ if (auth.languageCode) {
969
+ headers["X-Firebase-Locale" /* X_FIREBASE_LOCALE */] = auth.languageCode;
970
+ }
971
+ return [2 /*return*/, FetchProvider.fetch()(_getFinalTarget(auth, auth.config.apiHost, path, query), __assign({ method: method,
972
+ headers: headers, referrerPolicy: 'no-referrer' }, body))];
956
973
  }
957
- }
958
- var query = querystring(__assign({ key: auth.config.apiKey }, params)).slice(1);
959
- var headers = new (FetchProvider.headers())();
960
- headers.set("Content-Type" /* CONTENT_TYPE */, 'application/json');
961
- headers.set("X-Client-Version" /* X_CLIENT_VERSION */, auth._getSdkClientVersion());
962
- if (auth.languageCode) {
963
- headers.set("X-Firebase-Locale" /* X_FIREBASE_LOCALE */, auth.languageCode);
964
- }
965
- return FetchProvider.fetch()(_getFinalTarget(auth, auth.config.apiHost, path, query), __assign({ method: method,
966
- headers: headers, referrerPolicy: 'no-referrer' }, body));
967
- })];
974
+ });
975
+ }); })];
968
976
  });
969
977
  });
970
978
  }
@@ -1595,24 +1603,32 @@ function extractProviderData(providers) {
1595
1603
  function requestStsToken(auth, refreshToken) {
1596
1604
  return __awaiter(this, void 0, void 0, function () {
1597
1605
  var response;
1606
+ var _this = this;
1598
1607
  return __generator(this, function (_a) {
1599
1608
  switch (_a.label) {
1600
- case 0: return [4 /*yield*/, _performFetchWithErrorHandling(auth, {}, function () {
1601
- var body = querystring({
1602
- 'grant_type': 'refresh_token',
1603
- 'refresh_token': refreshToken
1604
- }).slice(1);
1605
- var _a = auth.config, tokenApiHost = _a.tokenApiHost, apiKey = _a.apiKey;
1606
- var url = _getFinalTarget(auth, tokenApiHost, "/v1/token" /* TOKEN */, "key=" + apiKey);
1607
- return FetchProvider.fetch()(url, {
1608
- method: "POST" /* POST */,
1609
- headers: {
1610
- 'X-Client-Version': auth._getSdkClientVersion(),
1611
- 'Content-Type': 'application/x-www-form-urlencoded'
1612
- },
1613
- body: body
1609
+ case 0: return [4 /*yield*/, _performFetchWithErrorHandling(auth, {}, function () { return __awaiter(_this, void 0, void 0, function () {
1610
+ var body, _a, tokenApiHost, apiKey, url, headers;
1611
+ return __generator(this, function (_b) {
1612
+ switch (_b.label) {
1613
+ case 0:
1614
+ body = querystring({
1615
+ 'grant_type': 'refresh_token',
1616
+ 'refresh_token': refreshToken
1617
+ }).slice(1);
1618
+ _a = auth.config, tokenApiHost = _a.tokenApiHost, apiKey = _a.apiKey;
1619
+ url = _getFinalTarget(auth, tokenApiHost, "/v1/token" /* TOKEN */, "key=" + apiKey);
1620
+ return [4 /*yield*/, auth._getAdditionalHeaders()];
1621
+ case 1:
1622
+ headers = _b.sent();
1623
+ headers["Content-Type" /* CONTENT_TYPE */] = 'application/x-www-form-urlencoded';
1624
+ return [2 /*return*/, FetchProvider.fetch()(url, {
1625
+ method: "POST" /* POST */,
1626
+ headers: headers,
1627
+ body: body
1628
+ })];
1629
+ }
1614
1630
  });
1615
- })];
1631
+ }); })];
1616
1632
  case 1:
1617
1633
  response = _a.sent();
1618
1634
  // The response comes back in snake_case. Convert to camel:
@@ -2519,13 +2535,19 @@ var AuthImpl = /** @class */ (function () {
2519
2535
  if (this._deleted) {
2520
2536
  return [2 /*return*/];
2521
2537
  }
2522
- if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/, 3];
2523
- return [4 /*yield*/, this._popupRedirectResolver._initialize(this)];
2538
+ if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/, 5];
2539
+ _d.label = 2;
2524
2540
  case 2:
2541
+ _d.trys.push([2, 4, , 5]);
2542
+ return [4 /*yield*/, this._popupRedirectResolver._initialize(this)];
2543
+ case 3:
2525
2544
  _d.sent();
2526
- _d.label = 3;
2527
- case 3: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
2545
+ return [3 /*break*/, 5];
2528
2546
  case 4:
2547
+ _d.sent();
2548
+ return [3 /*break*/, 5];
2549
+ case 5: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
2550
+ case 6:
2529
2551
  _d.sent();
2530
2552
  this.lastNotifiedUid = ((_c = this.currentUser) === null || _c === void 0 ? void 0 : _c.uid) || null;
2531
2553
  if (this._deleted) {
@@ -2666,7 +2688,7 @@ var AuthImpl = /** @class */ (function () {
2666
2688
  };
2667
2689
  AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
2668
2690
  return __awaiter(this, void 0, void 0, function () {
2669
- var e_2;
2691
+ var e_3;
2670
2692
  return __generator(this, function (_a) {
2671
2693
  switch (_a.label) {
2672
2694
  case 0:
@@ -2676,8 +2698,8 @@ var AuthImpl = /** @class */ (function () {
2676
2698
  _a.sent();
2677
2699
  return [3 /*break*/, 3];
2678
2700
  case 2:
2679
- e_2 = _a.sent();
2680
- if (e_2.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2701
+ e_3 = _a.sent();
2702
+ if (e_3.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2681
2703
  // Something's wrong with the user's token. Log them out and remove
2682
2704
  // them from storage
2683
2705
  return [2 /*return*/, this.directlySetCurrentUser(null)];
@@ -2986,8 +3008,20 @@ var AuthImpl = /** @class */ (function () {
2986
3008
  AuthImpl.prototype._getFrameworks = function () {
2987
3009
  return this.frameworks;
2988
3010
  };
2989
- AuthImpl.prototype._getSdkClientVersion = function () {
2990
- return this.clientVersion;
3011
+ AuthImpl.prototype._getAdditionalHeaders = function () {
3012
+ return __awaiter(this, void 0, void 0, function () {
3013
+ var headers;
3014
+ var _a;
3015
+ return __generator(this, function (_b) {
3016
+ headers = (_a = {},
3017
+ _a["X-Client-Version" /* X_CLIENT_VERSION */] = this.clientVersion,
3018
+ _a);
3019
+ if (this.app.options.appId) {
3020
+ headers["X-Firebase-gmpid" /* X_FIREBASE_GMPID */] = this.app.options.appId;
3021
+ }
3022
+ return [2 /*return*/, headers];
3023
+ });
3024
+ });
2991
3025
  };
2992
3026
  return AuthImpl;
2993
3027
  }());
@@ -10336,7 +10370,7 @@ function loadGapi(auth) {
10336
10370
  }
10337
10371
  };
10338
10372
  // Load GApi loader.
10339
- return _loadJS("https://apis.google.com/js/api.js?onload=" + cbName);
10373
+ return _loadJS("https://apis.google.com/js/api.js?onload=" + cbName).catch(function (e) { return reject(e); });
10340
10374
  }
10341
10375
  }).catch(function (error) {
10342
10376
  // Reset cached promise to allow for retrial.
@@ -10684,6 +10718,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
10684
10718
  });
10685
10719
  };
10686
10720
  BrowserPopupRedirectResolver.prototype._initialize = function (auth) {
10721
+ var _this = this;
10687
10722
  var key = auth._key();
10688
10723
  if (this.eventManagers[key]) {
10689
10724
  var _a = this.eventManagers[key], manager = _a.manager, promise_1 = _a.promise;
@@ -10697,6 +10732,11 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
10697
10732
  }
10698
10733
  var promise = this.initAndGetManager(auth);
10699
10734
  this.eventManagers[key] = { promise: promise };
10735
+ // If the promise is rejected, the key should be removed so that the
10736
+ // operation can be retried later.
10737
+ promise.catch(function () {
10738
+ delete _this.eventManagers[key];
10739
+ });
10700
10740
  return promise;
10701
10741
  };
10702
10742
  BrowserPopupRedirectResolver.prototype.initAndGetManager = function (auth) {
@@ -10833,7 +10873,7 @@ var PhoneMultiFactorGenerator = /** @class */ (function () {
10833
10873
  }());
10834
10874
 
10835
10875
  var name = "@firebase/auth";
10836
- var version = "0.19.3";
10876
+ var version = "0.19.4-canary.a185b1431";
10837
10877
 
10838
10878
  /**
10839
10879
  * @license
@@ -11038,4 +11078,4 @@ function getAuth(app) {
11038
11078
  registerAuth("Browser" /* BROWSER */);
11039
11079
 
11040
11080
  export { sendPasswordResetEmail as $, ActionCodeOperation as A, prodErrorMap as B, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as C, initializeAuth as D, connectAuthEmulator as E, FactorId as F, AuthCredential as G, EmailAuthCredential as H, OAuthCredential as I, PhoneAuthCredential as J, inMemoryPersistence as K, EmailAuthProvider as L, FacebookAuthProvider as M, GoogleAuthProvider as N, OperationType as O, PhoneAuthProvider as P, GithubAuthProvider as Q, RecaptchaVerifier as R, SignInMethod as S, OAuthProvider as T, SAMLAuthProvider as U, TwitterAuthProvider as V, signInAnonymously as W, signInWithCredential as X, linkWithCredential as Y, reauthenticateWithCredential as Z, signInWithCustomToken as _, browserSessionPersistence as a, confirmPasswordReset as a0, applyActionCode as a1, checkActionCode as a2, verifyPasswordResetCode as a3, createUserWithEmailAndPassword as a4, signInWithEmailAndPassword as a5, sendSignInLinkToEmail as a6, isSignInWithEmailLink as a7, signInWithEmailLink as a8, fetchSignInMethodsForEmail as a9, _clearRedirectOutcomes as aA, _getRedirectResult as aB, _castAuth as aC, UserImpl as aD, AuthImpl as aE, _getClientVersion as aF, _generateEventId as aG, AuthPopup as aH, FetchProvider as aI, SAMLAuthCredential as aJ, sendEmailVerification as aa, verifyBeforeUpdateEmail as ab, ActionCodeURL as ac, parseActionCodeURL as ad, updateProfile as ae, updateEmail as af, updatePassword as ag, getIdToken as ah, getIdTokenResult as ai, unlink as aj, getAdditionalUserInfo as ak, reload as al, getMultiFactorResolver as am, multiFactor as an, _isAndroid as ao, _isIOS7Or8 as ap, _isIOS as aq, _fail as ar, _getRedirectUrl as as, debugAssert as at, _getProjectConfig as au, _createError as av, _assert as aw, AuthEventManager as ax, _getInstance as ay, _persistenceKeyName as az, browserLocalPersistence as b, signInWithPopup as c, linkWithPopup as d, reauthenticateWithPopup as e, signInWithRedirect as f, linkWithRedirect as g, reauthenticateWithRedirect as h, indexedDBLocalPersistence as i, getRedirectResult as j, browserPopupRedirectResolver as k, linkWithPhoneNumber as l, PhoneMultiFactorGenerator as m, getAuth as n, ProviderId as o, setPersistence as p, onIdTokenChanged as q, reauthenticateWithPhoneNumber as r, signInWithPhoneNumber as s, onAuthStateChanged as t, updatePhoneNumber as u, useDeviceLanguage as v, updateCurrentUser as w, signOut as x, deleteUser as y, debugErrorMap as z };
11041
- //# sourceMappingURL=index-4f7e1a18.js.map
11081
+ //# sourceMappingURL=index-c216c700.js.map