@firebase/auth 0.19.3 → 0.19.4-2021117224551

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 (57) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/auth-public.d.ts +1 -2
  3. package/dist/auth.d.ts +1 -2
  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-238a0c49.js +9818 -0
  8. package/dist/cordova/popup_redirect-238a0c49.js.map +1 -0
  9. package/dist/cordova/{popup_redirect-1cde31c6.js → popup_redirect-abb8b03d.js} +14 -8
  10. package/dist/cordova/popup_redirect-abb8b03d.js.map +1 -0
  11. package/dist/cordova/src/model/public_types.d.ts +1 -2
  12. package/dist/esm2017/{index-8593558d.js → index-322e428b.js} +12 -3
  13. package/dist/esm2017/index-322e428b.js.map +1 -0
  14. package/dist/esm2017/index-b132db7f.js +9324 -0
  15. package/dist/esm2017/index-b132db7f.js.map +1 -0
  16. package/dist/esm2017/index.js +1 -1
  17. package/dist/esm2017/internal.js +2 -2
  18. package/dist/esm2017/src/model/public_types.d.ts +1 -2
  19. package/dist/esm5/index-52123638.js +11053 -0
  20. package/dist/esm5/index-52123638.js.map +1 -0
  21. package/dist/esm5/{index-4f7e1a18.js → index-7fbc9c07.js} +21 -9
  22. package/dist/esm5/index-7fbc9c07.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/model/public_types.d.ts +1 -2
  26. package/dist/index.webworker.esm5.js +14 -8
  27. package/dist/index.webworker.esm5.js.map +1 -1
  28. package/dist/node/index-547f3753.js +7210 -0
  29. package/dist/node/index-547f3753.js.map +1 -0
  30. package/dist/node/{index-057dcc31.js → index-55f24e76.js} +14 -8
  31. package/dist/node/index-55f24e76.js.map +1 -0
  32. package/dist/node/index.js +1 -1
  33. package/dist/node/internal.js +1 -1
  34. package/dist/node/src/model/public_types.d.ts +1 -2
  35. package/dist/node-esm/index-7d6d616c.js +6035 -0
  36. package/dist/node-esm/index-7d6d616c.js.map +1 -0
  37. package/dist/node-esm/{index-c327074d.js → index-8d4b7ac8.js} +6 -2
  38. package/dist/node-esm/index-8d4b7ac8.js.map +1 -0
  39. package/dist/node-esm/index.js +1 -1
  40. package/dist/node-esm/internal.js +2 -2
  41. package/dist/node-esm/src/model/public_types.d.ts +1 -2
  42. package/dist/rn/index.js +1 -1
  43. package/dist/rn/internal.js +8 -2
  44. package/dist/rn/internal.js.map +1 -1
  45. package/dist/rn/{phone-4c7624c1.js → phone-48b37abd.js} +14 -8
  46. package/dist/rn/phone-48b37abd.js.map +1 -0
  47. package/dist/rn/phone-f0c6106b.js +8287 -0
  48. package/dist/rn/phone-f0c6106b.js.map +1 -0
  49. package/dist/rn/src/model/public_types.d.ts +1 -2
  50. package/dist/src/model/public_types.d.ts +1 -2
  51. package/package.json +4 -3
  52. package/dist/cordova/popup_redirect-1cde31c6.js.map +0 -1
  53. package/dist/esm2017/index-8593558d.js.map +0 -1
  54. package/dist/esm5/index-4f7e1a18.js.map +0 -1
  55. package/dist/node/index-057dcc31.js.map +0 -1
  56. package/dist/node-esm/index-c327074d.js.map +0 -1
  57. package/dist/rn/phone-4c7624c1.js.map +0 -1
@@ -2519,13 +2519,19 @@ var AuthImpl = /** @class */ (function () {
2519
2519
  if (this._deleted) {
2520
2520
  return [2 /*return*/];
2521
2521
  }
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)];
2522
+ if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/, 5];
2523
+ _d.label = 2;
2524
2524
  case 2:
2525
+ _d.trys.push([2, 4, , 5]);
2526
+ return [4 /*yield*/, this._popupRedirectResolver._initialize(this)];
2527
+ case 3:
2525
2528
  _d.sent();
2526
- _d.label = 3;
2527
- case 3: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
2529
+ return [3 /*break*/, 5];
2528
2530
  case 4:
2531
+ _d.sent();
2532
+ return [3 /*break*/, 5];
2533
+ case 5: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
2534
+ case 6:
2529
2535
  _d.sent();
2530
2536
  this.lastNotifiedUid = ((_c = this.currentUser) === null || _c === void 0 ? void 0 : _c.uid) || null;
2531
2537
  if (this._deleted) {
@@ -2666,7 +2672,7 @@ var AuthImpl = /** @class */ (function () {
2666
2672
  };
2667
2673
  AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
2668
2674
  return __awaiter(this, void 0, void 0, function () {
2669
- var e_2;
2675
+ var e_3;
2670
2676
  return __generator(this, function (_a) {
2671
2677
  switch (_a.label) {
2672
2678
  case 0:
@@ -2676,8 +2682,8 @@ var AuthImpl = /** @class */ (function () {
2676
2682
  _a.sent();
2677
2683
  return [3 /*break*/, 3];
2678
2684
  case 2:
2679
- e_2 = _a.sent();
2680
- if (e_2.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2685
+ e_3 = _a.sent();
2686
+ if (e_3.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2681
2687
  // Something's wrong with the user's token. Log them out and remove
2682
2688
  // them from storage
2683
2689
  return [2 /*return*/, this.directlySetCurrentUser(null)];
@@ -10336,7 +10342,7 @@ function loadGapi(auth) {
10336
10342
  }
10337
10343
  };
10338
10344
  // Load GApi loader.
10339
- return _loadJS("https://apis.google.com/js/api.js?onload=" + cbName);
10345
+ return _loadJS("https://apis.google.com/js/api.js?onload=" + cbName).catch(function (e) { return reject(e); });
10340
10346
  }
10341
10347
  }).catch(function (error) {
10342
10348
  // Reset cached promise to allow for retrial.
@@ -10684,6 +10690,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
10684
10690
  });
10685
10691
  };
10686
10692
  BrowserPopupRedirectResolver.prototype._initialize = function (auth) {
10693
+ var _this = this;
10687
10694
  var key = auth._key();
10688
10695
  if (this.eventManagers[key]) {
10689
10696
  var _a = this.eventManagers[key], manager = _a.manager, promise_1 = _a.promise;
@@ -10697,6 +10704,11 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
10697
10704
  }
10698
10705
  var promise = this.initAndGetManager(auth);
10699
10706
  this.eventManagers[key] = { promise: promise };
10707
+ // If the promise is rejected, the key should be removed so that the
10708
+ // operation can be retried later.
10709
+ promise.catch(function () {
10710
+ delete _this.eventManagers[key];
10711
+ });
10700
10712
  return promise;
10701
10713
  };
10702
10714
  BrowserPopupRedirectResolver.prototype.initAndGetManager = function (auth) {
@@ -11038,4 +11050,4 @@ function getAuth(app) {
11038
11050
  registerAuth("Browser" /* BROWSER */);
11039
11051
 
11040
11052
  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
11053
+ //# sourceMappingURL=index-7fbc9c07.js.map