@firebase/auth 1.13.4 → 1.13.5

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 (49) hide show
  1. package/dist/browser-cjs/{index-D1eM-zGc.js → index-DY73Er5u.js} +12 -30
  2. package/dist/browser-cjs/index-DY73Er5u.js.map +1 -0
  3. package/dist/browser-cjs/index.js +1 -1
  4. package/dist/browser-cjs/internal.js +1 -1
  5. package/dist/cordova/index.js +2 -2
  6. package/dist/cordova/internal.js +2 -2
  7. package/dist/cordova/internal.js.map +1 -1
  8. package/dist/cordova/{popup_redirect-B-tPyF2Y.js → popup_redirect-D_ZWtJhY.js} +12 -30
  9. package/dist/cordova/popup_redirect-D_ZWtJhY.js.map +1 -0
  10. package/dist/esm/{index-DGK4UgBf.js → index-CvXU3_1x.js} +12 -30
  11. package/dist/esm/index-CvXU3_1x.js.map +1 -0
  12. package/dist/esm/index.js +1 -1
  13. package/dist/esm/internal.js +2 -2
  14. package/dist/index.webworker.js +11 -29
  15. package/dist/index.webworker.js.map +1 -1
  16. package/dist/node/index.js +1 -1
  17. package/dist/node/internal.js +1 -1
  18. package/dist/node/internal.js.map +1 -1
  19. package/dist/node/{totp-D1uGng8T.js → totp-B19JzI52.js} +2 -2
  20. package/dist/node/totp-B19JzI52.js.map +1 -0
  21. package/dist/node-esm/index.js +1 -1
  22. package/dist/node-esm/internal.js +2 -2
  23. package/dist/node-esm/internal.js.map +1 -1
  24. package/dist/node-esm/{totp-C7PFgVcO.js → totp-C24pd8aS.js} +2 -2
  25. package/dist/node-esm/totp-C24pd8aS.js.map +1 -0
  26. package/dist/rn/{index-bWGFqYVI.js → index-CiDS6PaG.js} +2 -2
  27. package/dist/rn/index-CiDS6PaG.js.map +1 -0
  28. package/dist/rn/index.js +1 -1
  29. package/dist/rn/internal.js +11 -29
  30. package/dist/rn/internal.js.map +1 -1
  31. package/dist/web-extension-cjs/index.js +1 -1
  32. package/dist/web-extension-cjs/internal.js +1 -1
  33. package/dist/web-extension-cjs/internal.js.map +1 -1
  34. package/dist/web-extension-cjs/{register-CFPR54H_.js → register-dQ43sygv.js} +12 -30
  35. package/dist/web-extension-cjs/register-dQ43sygv.js.map +1 -0
  36. package/dist/web-extension-esm/index.js +2 -2
  37. package/dist/web-extension-esm/internal.js +2 -2
  38. package/dist/web-extension-esm/internal.js.map +1 -1
  39. package/dist/web-extension-esm/{register-Ct10ccti.js → register-DN05P0kB.js} +12 -30
  40. package/dist/web-extension-esm/register-DN05P0kB.js.map +1 -0
  41. package/package.json +5 -6
  42. package/dist/browser-cjs/index-D1eM-zGc.js.map +0 -1
  43. package/dist/cordova/popup_redirect-B-tPyF2Y.js.map +0 -1
  44. package/dist/esm/index-DGK4UgBf.js.map +0 -1
  45. package/dist/node/totp-D1uGng8T.js.map +0 -1
  46. package/dist/node-esm/totp-C7PFgVcO.js.map +0 -1
  47. package/dist/rn/index-bWGFqYVI.js.map +0 -1
  48. package/dist/web-extension-cjs/register-CFPR54H_.js.map +0 -1
  49. package/dist/web-extension-esm/register-Ct10ccti.js.map +0 -1
@@ -495,10 +495,6 @@ class IndexedDBLocalPersistence {
495
495
  window.addEventListener('pagehide', this.onPageHide);
496
496
  window.addEventListener('pageshow', this.onPageShow);
497
497
  }
498
- if (typeof document !== 'undefined' &&
499
- typeof document.addEventListener === 'function') {
500
- document.addEventListener('visibilitychange', this.onVisibilityChange);
501
- }
502
498
  }
503
499
  unregisterLifecycleListeners() {
504
500
  if (typeof window !== 'undefined' &&
@@ -506,10 +502,6 @@ class IndexedDBLocalPersistence {
506
502
  window.removeEventListener('pagehide', this.onPageHide);
507
503
  window.removeEventListener('pageshow', this.onPageShow);
508
504
  }
509
- if (typeof document !== 'undefined' &&
510
- typeof document.removeEventListener === 'function') {
511
- document.removeEventListener('visibilitychange', this.onVisibilityChange);
512
- }
513
505
  }
514
506
  constructor() {
515
507
  this.type = "LOCAL" /* PersistenceType.LOCAL */;
@@ -520,14 +512,14 @@ class IndexedDBLocalPersistence {
520
512
  // setTimeout return value is platform specific
521
513
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
522
514
  this.pollTimer = null;
523
- this.isHiding = false;
515
+ this.isClosing = false;
524
516
  this.pendingWrites = 0;
525
517
  this.receiver = null;
526
518
  this.sender = null;
527
519
  this.serviceWorkerReceiverAvailable = false;
528
520
  this.activeServiceWorker = null;
529
521
  this.onPageHide = () => {
530
- this.isHiding = true;
522
+ this.isClosing = true;
531
523
  this.stopPolling();
532
524
  if (this.dbPromise) {
533
525
  this.dbPromise.then(db => db.close()).catch(() => { });
@@ -535,30 +527,20 @@ class IndexedDBLocalPersistence {
535
527
  }
536
528
  };
537
529
  this.onPageShow = () => {
538
- if (this.isHiding) {
539
- this.isHiding = false;
530
+ if (this.isClosing) {
531
+ this.isClosing = false;
540
532
  if (Object.keys(this.listeners).length > 0) {
541
533
  this.startPolling();
542
534
  }
543
535
  }
544
536
  };
545
- this.onVisibilityChange = () => {
546
- if (typeof document !== 'undefined') {
547
- if (document.visibilityState === 'hidden') {
548
- this.onPageHide();
549
- }
550
- else if (document.visibilityState === 'visible') {
551
- this.onPageShow();
552
- }
553
- }
554
- };
555
537
  // Fire & forget the service worker registration as it may never resolve
556
538
  this._workerInitializationPromise =
557
539
  this.initializeServiceWorkerMessaging().then(() => { }, () => { });
558
540
  }
559
541
  async _openDb() {
560
- if (this.isHiding) {
561
- throw new Error('Database is closing/hidden');
542
+ if (this.isClosing) {
543
+ throw new Error('Database is closing');
562
544
  }
563
545
  if (this.dbPromise) {
564
546
  return this.dbPromise;
@@ -577,7 +559,7 @@ class IndexedDBLocalPersistence {
577
559
  return await op(db);
578
560
  }
579
561
  catch (e) {
580
- if (this.isHiding) {
562
+ if (this.isClosing) {
581
563
  throw e;
582
564
  }
583
565
  if (numAttempts++ > _TRANSACTION_RETRY_COUNT) {
@@ -709,7 +691,7 @@ class IndexedDBLocalPersistence {
709
691
  });
710
692
  }
711
693
  async _poll() {
712
- if (this.isHiding) {
694
+ if (this.isClosing) {
713
695
  return [];
714
696
  }
715
697
  try {
@@ -718,7 +700,7 @@ class IndexedDBLocalPersistence {
718
700
  const getAllRequest = getObjectStore(db, false).getAll();
719
701
  return new DBPromise(getAllRequest).toPromise();
720
702
  });
721
- if (this.isHiding) {
703
+ if (this.isClosing) {
722
704
  return [];
723
705
  }
724
706
  if (!result) {
@@ -749,7 +731,7 @@ class IndexedDBLocalPersistence {
749
731
  return keys;
750
732
  }
751
733
  catch (e) {
752
- if (!this.isHiding) {
734
+ if (!this.isClosing) {
753
735
  _logWarn(`Firebase Auth cross-tab polling failed with error: ${e}`);
754
736
  }
755
737
  return [];
@@ -8050,7 +8032,7 @@ function multiFactor(user) {
8050
8032
  }
8051
8033
 
8052
8034
  var name = "@firebase/auth";
8053
- var version = "1.13.4";
8035
+ var version = "1.13.5";
8054
8036
 
8055
8037
  /**
8056
8038
  * @license
@@ -9864,4 +9846,4 @@ function generateNoEvent() {
9864
9846
  }
9865
9847
 
9866
9848
  export { sendEmailVerification as $, ActionCodeOperation as A, fetchSignInMethodsForEmail as B, getAdditionalUserInfo as C, getIdToken as D, EmailAuthCredential as E, FacebookAuthProvider as F, GithubAuthProvider as G, getIdTokenResult as H, getMultiFactorResolver as I, getRedirectResult as J, inMemoryPersistence as K, initializeRecaptchaConfig as L, isSignInWithEmailLink as M, linkWithCredential as N, OAuthCredential as O, PhoneAuthCredential as P, multiFactor as Q, onAuthStateChanged as R, SAMLAuthProvider as S, TwitterAuthProvider as T, onIdTokenChanged as U, parseActionCodeURL as V, prodErrorMap as W, reauthenticateWithCredential as X, reload as Y, revokeAccessToken as Z, _linkWithRedirect as _, _reauthenticateWithRedirect as a, debugFail as a$, sendPasswordResetEmail as a0, sendSignInLinkToEmail as a1, setPersistence as a2, signInAnonymously as a3, signInWithCredential as a4, signInWithCustomToken as a5, signInWithEmailAndPassword as a6, signInWithEmailLink as a7, signOut as a8, unlink as a9, _initializeRecaptchaConfig as aA, FAKE_TOKEN as aB, startEnrollPhoneMfa as aC, handleRecaptchaFlow as aD, sendPhoneVerificationCode as aE, _assertInstanceOf as aF, _withDefaultResolver as aG, AbstractPopupRedirectOperation as aH, debugAssert as aI, _generateEventId as aJ, FederatedAuthProvider as aK, _getProjectConfig as aL, _fail as aM, _getCurrentUrl as aN, _gapiScriptUrl as aO, _emulatorUrl as aP, _isChromeIOS as aQ, _isFirefox as aR, _isIOSStandalone as aS, _getRedirectResult as aT, _overrideRedirectResult as aU, _getRedirectUrl as aV, _setWindowLocation as aW, AuthEventManager as aX, _isMobileBrowser as aY, _isSafari as aZ, _isIOS as a_, updateCurrentUser as aa, updateEmail as ab, updatePassword as ac, updateProfile as ad, useDeviceLanguage as ae, validatePassword as af, verifyBeforeUpdateEmail as ag, verifyPasswordResetCode as ah, _performApiRequest as ai, _addTidIfNecessary as aj, Delay as ak, MockReCaptcha as al, _window as am, _assert as an, isV2 as ao, _createError as ap, _recaptchaV2ScriptUrl as aq, _loadJS as ar, _generateCallbackName as as, _castAuth as at, _isHttpOrHttps as au, _isWorker as av, getRecaptchaParams as aw, _assertLinkedStatus as ax, _serverAppCurrentUserOperationNotSupportedError as ay, _link$1 as az, _signInWithRedirect as b, finalizeEnrollPhoneMfa as b0, startEnrollTotpMfa as b1, finalizeEnrollTotpMfa as b2, _setExternalJSProvider as b3, AuthImpl as b4, FetchProvider as b5, SAMLAuthCredential as b6, UserImpl as b7, _getClientVersion as b8, _getInstance as b9, _persistenceKeyName as ba, linkWithRedirect as bb, reauthenticateWithRedirect as bc, signInWithRedirect as bd, cordovaPopupRedirectResolver as c, indexedDBLocalPersistence as d, ActionCodeURL as e, AuthCredential as f, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as g, EmailAuthProvider as h, initializeAuth as i, FactorId as j, GoogleAuthProvider as k, OAuthProvider as l, OperationType as m, ProviderId as n, SignInMethod as o, applyActionCode as p, beforeAuthStateChanged as q, registerAuth as r, browserLocalPersistence as s, browserSessionPersistence as t, checkActionCode as u, confirmPasswordReset as v, connectAuthEmulator as w, createUserWithEmailAndPassword as x, debugErrorMap as y, deleteUser as z };
9867
- //# sourceMappingURL=popup_redirect-B-tPyF2Y.js.map
9849
+ //# sourceMappingURL=popup_redirect-D_ZWtJhY.js.map