@firebase/auth 1.13.3-eap-crashlytics.659b578fb → 1.13.4-20260728185501

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 (37) hide show
  1. package/dist/browser-cjs/{index-DLAcLH17.js → index-TiyvRZm6.js} +97 -26
  2. package/dist/{esm/index-DIozsb1n.js.map → browser-cjs/index-TiyvRZm6.js.map} +1 -1
  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/{popup_redirect-DU-rQFxl.js → popup_redirect-Be0Melsy.js} +125 -54
  8. package/dist/cordova/popup_redirect-Be0Melsy.js.map +1 -0
  9. package/dist/esm/{index-DIozsb1n.js → index-DqtyKhzu.js} +97 -26
  10. package/dist/{browser-cjs/index-DLAcLH17.js.map → esm/index-DqtyKhzu.js.map} +1 -1
  11. package/dist/esm/index.js +1 -1
  12. package/dist/esm/internal.js +2 -2
  13. package/dist/index.webworker.js +96 -25
  14. package/dist/index.webworker.js.map +1 -1
  15. package/dist/node/index.js +1 -1
  16. package/dist/node/internal.js +1 -1
  17. package/dist/node/{totp-BwsckFdy.js → totp-D8cjDKiH.js} +2 -2
  18. package/dist/node/{totp-BwsckFdy.js.map → totp-D8cjDKiH.js.map} +1 -1
  19. package/dist/node-esm/index.js +1 -1
  20. package/dist/node-esm/internal.js +2 -2
  21. package/dist/node-esm/{totp-BqsE7qvo.js → totp-BkwAJFrn.js} +2 -2
  22. package/dist/node-esm/{totp-BqsE7qvo.js.map → totp-BkwAJFrn.js.map} +1 -1
  23. package/dist/rn/{index-96z01bxX.js → index-BzcHGbdh.js} +2 -2
  24. package/dist/rn/{index-96z01bxX.js.map → index-BzcHGbdh.js.map} +1 -1
  25. package/dist/rn/index.js +1 -1
  26. package/dist/rn/internal.js +96 -25
  27. package/dist/rn/internal.js.map +1 -1
  28. package/dist/web-extension-cjs/index.js +1 -1
  29. package/dist/web-extension-cjs/internal.js +1 -1
  30. package/dist/web-extension-cjs/{register-B1PXHVFP.js → register-Bk5zU3vt.js} +97 -26
  31. package/dist/{web-extension-esm/register-B7zfGmPU.js.map → web-extension-cjs/register-Bk5zU3vt.js.map} +1 -1
  32. package/dist/web-extension-esm/index.js +2 -2
  33. package/dist/web-extension-esm/internal.js +2 -2
  34. package/dist/web-extension-esm/{register-B7zfGmPU.js → register-CGKCII54.js} +97 -26
  35. package/dist/{web-extension-cjs/register-B1PXHVFP.js.map → web-extension-esm/register-CGKCII54.js.map} +1 -1
  36. package/package.json +6 -6
  37. package/dist/cordova/popup_redirect-DU-rQFxl.js.map +0 -1
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ActionCodeOperation, a as ActionCodeURL, b as AuthCredential, c as AuthErrorCodes, E as EmailAuthCredential, d as EmailAuthProvider, F as FacebookAuthProvider, e as FactorId, G as GithubAuthProvider, f as GoogleAuthProvider, O as OAuthCredential, g as OAuthProvider, h as OperationType, P as PhoneAuthCredential, i as PhoneAuthProvider, j as PhoneMultiFactorGenerator, k as ProviderId, R as RecaptchaVerifier, S as SAMLAuthProvider, l as SignInMethod, T as TotpMultiFactorGenerator, m as TotpSecret, n as TwitterAuthProvider, o as applyActionCode, p as beforeAuthStateChanged, q as browserCookiePersistence, r as browserLocalPersistence, s as browserPopupRedirectResolver, t as browserSessionPersistence, u as checkActionCode, v as confirmPasswordReset, w as connectAuthEmulator, x as createUserWithEmailAndPassword, y as debugErrorMap, z as deleteUser, B as fetchSignInMethodsForEmail, C as getAdditionalUserInfo, D as getAuth, H as getIdToken, I as getIdTokenResult, J as getMultiFactorResolver, K as getRedirectResult, L as inMemoryPersistence, M as indexedDBLocalPersistence, N as initializeAuth, Q as initializeRecaptchaConfig, U as isSignInWithEmailLink, V as linkWithCredential, W as linkWithPhoneNumber, X as linkWithPopup, Y as linkWithRedirect, Z as multiFactor, _ as onAuthStateChanged, $ as onIdTokenChanged, a0 as parseActionCodeURL, a1 as prodErrorMap, a2 as reauthenticateWithCredential, a3 as reauthenticateWithPhoneNumber, a4 as reauthenticateWithPopup, a5 as reauthenticateWithRedirect, a6 as reload, a7 as revokeAccessToken, a8 as sendEmailVerification, a9 as sendPasswordResetEmail, aa as sendSignInLinkToEmail, ab as setPersistence, ac as signInAnonymously, ad as signInWithCredential, ae as signInWithCustomToken, af as signInWithEmailAndPassword, ag as signInWithEmailLink, ah as signInWithPhoneNumber, ai as signInWithPopup, aj as signInWithRedirect, ak as signOut, al as unlink, am as updateCurrentUser, an as updateEmail, ao as updatePassword, ap as updatePhoneNumber, aq as updateProfile, ar as useDeviceLanguage, as as validatePassword, at as verifyBeforeUpdateEmail, au as verifyPasswordResetCode } from './index-DIozsb1n.js';
1
+ export { A as ActionCodeOperation, a as ActionCodeURL, b as AuthCredential, c as AuthErrorCodes, E as EmailAuthCredential, d as EmailAuthProvider, F as FacebookAuthProvider, e as FactorId, G as GithubAuthProvider, f as GoogleAuthProvider, O as OAuthCredential, g as OAuthProvider, h as OperationType, P as PhoneAuthCredential, i as PhoneAuthProvider, j as PhoneMultiFactorGenerator, k as ProviderId, R as RecaptchaVerifier, S as SAMLAuthProvider, l as SignInMethod, T as TotpMultiFactorGenerator, m as TotpSecret, n as TwitterAuthProvider, o as applyActionCode, p as beforeAuthStateChanged, q as browserCookiePersistence, r as browserLocalPersistence, s as browserPopupRedirectResolver, t as browserSessionPersistence, u as checkActionCode, v as confirmPasswordReset, w as connectAuthEmulator, x as createUserWithEmailAndPassword, y as debugErrorMap, z as deleteUser, B as fetchSignInMethodsForEmail, C as getAdditionalUserInfo, D as getAuth, H as getIdToken, I as getIdTokenResult, J as getMultiFactorResolver, K as getRedirectResult, L as inMemoryPersistence, M as indexedDBLocalPersistence, N as initializeAuth, Q as initializeRecaptchaConfig, U as isSignInWithEmailLink, V as linkWithCredential, W as linkWithPhoneNumber, X as linkWithPopup, Y as linkWithRedirect, Z as multiFactor, _ as onAuthStateChanged, $ as onIdTokenChanged, a0 as parseActionCodeURL, a1 as prodErrorMap, a2 as reauthenticateWithCredential, a3 as reauthenticateWithPhoneNumber, a4 as reauthenticateWithPopup, a5 as reauthenticateWithRedirect, a6 as reload, a7 as revokeAccessToken, a8 as sendEmailVerification, a9 as sendPasswordResetEmail, aa as sendSignInLinkToEmail, ab as setPersistence, ac as signInAnonymously, ad as signInWithCredential, ae as signInWithCustomToken, af as signInWithEmailAndPassword, ag as signInWithEmailLink, ah as signInWithPhoneNumber, ai as signInWithPopup, aj as signInWithRedirect, ak as signOut, al as unlink, am as updateCurrentUser, an as updateEmail, ao as updatePassword, ap as updatePhoneNumber, aq as updateProfile, ar as useDeviceLanguage, as as validatePassword, at as verifyBeforeUpdateEmail, au as verifyPasswordResetCode } from './index-DqtyKhzu.js';
2
2
  import '@firebase/app';
3
3
  import '@firebase/util';
4
4
  import '@firebase/logger';
@@ -1,5 +1,5 @@
1
- import { av as _assert, aw as debugAssert, ax as _isIOS, ay as _isAndroid, az as _fail, aA as _getRedirectUrl, aB as _isIOS7Or8, aC as _createError, aD as _getProjectConfig, aE as AuthEventManager, aF as _getInstance, r as browserLocalPersistence, aG as _persistenceKeyName, t as browserSessionPersistence, aH as _getRedirectResult, aI as _overrideRedirectResult, aJ as _clearRedirectOutcomes, aK as _castAuth } from './index-DIozsb1n.js';
2
- export { A as ActionCodeOperation, a as ActionCodeURL, b as AuthCredential, c as AuthErrorCodes, aL as AuthImpl, aM as AuthPopup, E as EmailAuthCredential, d as EmailAuthProvider, F as FacebookAuthProvider, e as FactorId, aN as FetchProvider, G as GithubAuthProvider, f as GoogleAuthProvider, O as OAuthCredential, g as OAuthProvider, h as OperationType, P as PhoneAuthCredential, i as PhoneAuthProvider, j as PhoneMultiFactorGenerator, k as ProviderId, R as RecaptchaVerifier, aO as SAMLAuthCredential, S as SAMLAuthProvider, l as SignInMethod, T as TotpMultiFactorGenerator, m as TotpSecret, n as TwitterAuthProvider, aP as UserImpl, aQ as _generateEventId, aR as _getClientVersion, o as applyActionCode, p as beforeAuthStateChanged, q as browserCookiePersistence, s as browserPopupRedirectResolver, u as checkActionCode, v as confirmPasswordReset, w as connectAuthEmulator, x as createUserWithEmailAndPassword, y as debugErrorMap, z as deleteUser, B as fetchSignInMethodsForEmail, C as getAdditionalUserInfo, D as getAuth, H as getIdToken, I as getIdTokenResult, J as getMultiFactorResolver, K as getRedirectResult, L as inMemoryPersistence, M as indexedDBLocalPersistence, N as initializeAuth, Q as initializeRecaptchaConfig, U as isSignInWithEmailLink, V as linkWithCredential, W as linkWithPhoneNumber, X as linkWithPopup, Y as linkWithRedirect, Z as multiFactor, _ as onAuthStateChanged, $ as onIdTokenChanged, a0 as parseActionCodeURL, a1 as prodErrorMap, a2 as reauthenticateWithCredential, a3 as reauthenticateWithPhoneNumber, a4 as reauthenticateWithPopup, a5 as reauthenticateWithRedirect, a6 as reload, a7 as revokeAccessToken, a8 as sendEmailVerification, a9 as sendPasswordResetEmail, aa as sendSignInLinkToEmail, ab as setPersistence, ac as signInAnonymously, ad as signInWithCredential, ae as signInWithCustomToken, af as signInWithEmailAndPassword, ag as signInWithEmailLink, ah as signInWithPhoneNumber, ai as signInWithPopup, aj as signInWithRedirect, ak as signOut, al as unlink, am as updateCurrentUser, an as updateEmail, ao as updatePassword, ap as updatePhoneNumber, aq as updateProfile, ar as useDeviceLanguage, as as validatePassword, at as verifyBeforeUpdateEmail, au as verifyPasswordResetCode } from './index-DIozsb1n.js';
1
+ import { av as _assert, aw as debugAssert, ax as _isIOS, ay as _isAndroid, az as _fail, aA as _getRedirectUrl, aB as _isIOS7Or8, aC as _createError, aD as _getProjectConfig, aE as AuthEventManager, aF as _getInstance, r as browserLocalPersistence, aG as _persistenceKeyName, t as browserSessionPersistence, aH as _getRedirectResult, aI as _overrideRedirectResult, aJ as _clearRedirectOutcomes, aK as _castAuth } from './index-DqtyKhzu.js';
2
+ export { A as ActionCodeOperation, a as ActionCodeURL, b as AuthCredential, c as AuthErrorCodes, aL as AuthImpl, aM as AuthPopup, E as EmailAuthCredential, d as EmailAuthProvider, F as FacebookAuthProvider, e as FactorId, aN as FetchProvider, G as GithubAuthProvider, f as GoogleAuthProvider, O as OAuthCredential, g as OAuthProvider, h as OperationType, P as PhoneAuthCredential, i as PhoneAuthProvider, j as PhoneMultiFactorGenerator, k as ProviderId, R as RecaptchaVerifier, aO as SAMLAuthCredential, S as SAMLAuthProvider, l as SignInMethod, T as TotpMultiFactorGenerator, m as TotpSecret, n as TwitterAuthProvider, aP as UserImpl, aQ as _generateEventId, aR as _getClientVersion, o as applyActionCode, p as beforeAuthStateChanged, q as browserCookiePersistence, s as browserPopupRedirectResolver, u as checkActionCode, v as confirmPasswordReset, w as connectAuthEmulator, x as createUserWithEmailAndPassword, y as debugErrorMap, z as deleteUser, B as fetchSignInMethodsForEmail, C as getAdditionalUserInfo, D as getAuth, H as getIdToken, I as getIdTokenResult, J as getMultiFactorResolver, K as getRedirectResult, L as inMemoryPersistence, M as indexedDBLocalPersistence, N as initializeAuth, Q as initializeRecaptchaConfig, U as isSignInWithEmailLink, V as linkWithCredential, W as linkWithPhoneNumber, X as linkWithPopup, Y as linkWithRedirect, Z as multiFactor, _ as onAuthStateChanged, $ as onIdTokenChanged, a0 as parseActionCodeURL, a1 as prodErrorMap, a2 as reauthenticateWithCredential, a3 as reauthenticateWithPhoneNumber, a4 as reauthenticateWithPopup, a5 as reauthenticateWithRedirect, a6 as reload, a7 as revokeAccessToken, a8 as sendEmailVerification, a9 as sendPasswordResetEmail, aa as sendSignInLinkToEmail, ab as setPersistence, ac as signInAnonymously, ad as signInWithCredential, ae as signInWithCustomToken, af as signInWithEmailAndPassword, ag as signInWithEmailLink, ah as signInWithPhoneNumber, ai as signInWithPopup, aj as signInWithRedirect, ak as signOut, al as unlink, am as updateCurrentUser, an as updateEmail, ao as updatePassword, ap as updatePhoneNumber, aq as updateProfile, ar as useDeviceLanguage, as as validatePassword, at as verifyBeforeUpdateEmail, au as verifyPasswordResetCode } from './index-DqtyKhzu.js';
3
3
  import { querystringDecode } from '@firebase/util';
4
4
  import '@firebase/app';
5
5
  import '@firebase/logger';
@@ -533,7 +533,7 @@ function _initializeAuthInstance(auth, deps) {
533
533
  }
534
534
 
535
535
  var name = "@firebase/auth";
536
- var version = "1.13.3-eap-crashlytics.659b578fb";
536
+ var version = "1.13.4-20260728185501";
537
537
 
538
538
  /**
539
539
  * @license
@@ -3657,6 +3657,28 @@ function _deleteObject(db, key) {
3657
3657
  const _POLLING_INTERVAL_MS = 800;
3658
3658
  const _TRANSACTION_RETRY_COUNT = 3;
3659
3659
  class IndexedDBLocalPersistence {
3660
+ registerLifecycleListeners() {
3661
+ if (typeof window !== 'undefined' &&
3662
+ typeof window.addEventListener === 'function') {
3663
+ window.addEventListener('pagehide', this.onPageHide);
3664
+ window.addEventListener('pageshow', this.onPageShow);
3665
+ }
3666
+ if (typeof document !== 'undefined' &&
3667
+ typeof document.addEventListener === 'function') {
3668
+ document.addEventListener('visibilitychange', this.onVisibilityChange);
3669
+ }
3670
+ }
3671
+ unregisterLifecycleListeners() {
3672
+ if (typeof window !== 'undefined' &&
3673
+ typeof window.removeEventListener === 'function') {
3674
+ window.removeEventListener('pagehide', this.onPageHide);
3675
+ window.removeEventListener('pageshow', this.onPageShow);
3676
+ }
3677
+ if (typeof document !== 'undefined' &&
3678
+ typeof document.removeEventListener === 'function') {
3679
+ document.removeEventListener('visibilitychange', this.onVisibilityChange);
3680
+ }
3681
+ }
3660
3682
  constructor() {
3661
3683
  this.type = "LOCAL" /* PersistenceType.LOCAL */;
3662
3684
  this.dbPromise = null;
@@ -3666,16 +3688,46 @@ class IndexedDBLocalPersistence {
3666
3688
  // setTimeout return value is platform specific
3667
3689
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3668
3690
  this.pollTimer = null;
3691
+ this.isHiding = false;
3669
3692
  this.pendingWrites = 0;
3670
3693
  this.receiver = null;
3671
3694
  this.sender = null;
3672
3695
  this.serviceWorkerReceiverAvailable = false;
3673
3696
  this.activeServiceWorker = null;
3697
+ this.onPageHide = () => {
3698
+ this.isHiding = true;
3699
+ this.stopPolling();
3700
+ if (this.dbPromise) {
3701
+ this.dbPromise.then(db => db.close()).catch(() => { });
3702
+ this.dbPromise = null;
3703
+ }
3704
+ };
3705
+ this.onPageShow = () => {
3706
+ if (this.isHiding) {
3707
+ this.isHiding = false;
3708
+ if (Object.keys(this.listeners).length > 0) {
3709
+ this.startPolling();
3710
+ }
3711
+ }
3712
+ };
3713
+ this.onVisibilityChange = () => {
3714
+ if (typeof document !== 'undefined') {
3715
+ if (document.visibilityState === 'hidden') {
3716
+ this.onPageHide();
3717
+ }
3718
+ else if (document.visibilityState === 'visible') {
3719
+ this.onPageShow();
3720
+ }
3721
+ }
3722
+ };
3674
3723
  // Fire & forget the service worker registration as it may never resolve
3675
3724
  this._workerInitializationPromise =
3676
3725
  this.initializeServiceWorkerMessaging().then(() => { }, () => { });
3677
3726
  }
3678
3727
  async _openDb() {
3728
+ if (this.isHiding) {
3729
+ throw new Error('Database is closing/hidden');
3730
+ }
3679
3731
  if (this.dbPromise) {
3680
3732
  return this.dbPromise;
3681
3733
  }
@@ -3693,6 +3745,9 @@ class IndexedDBLocalPersistence {
3693
3745
  return await op(db);
3694
3746
  }
3695
3747
  catch (e) {
3748
+ if (this.isHiding) {
3749
+ throw e;
3750
+ }
3696
3751
  if (numAttempts++ > _TRANSACTION_RETRY_COUNT) {
3697
3752
  throw e;
3698
3753
  }
@@ -3822,37 +3877,51 @@ class IndexedDBLocalPersistence {
3822
3877
  });
3823
3878
  }
3824
3879
  async _poll() {
3825
- // TODO: check if we need to fallback if getAll is not supported
3826
- const result = await this._withRetries((db) => {
3827
- const getAllRequest = getObjectStore(db, false).getAll();
3828
- return new DBPromise(getAllRequest).toPromise();
3829
- });
3830
- if (!result) {
3880
+ if (this.isHiding) {
3831
3881
  return [];
3832
3882
  }
3833
- // If we have pending writes in progress abort, we'll get picked up on the next poll
3834
- if (this.pendingWrites !== 0) {
3835
- return [];
3836
- }
3837
- const keys = [];
3838
- const keysInResult = new Set();
3839
- if (result.length !== 0) {
3840
- for (const { fbase_key: key, value } of result) {
3841
- keysInResult.add(key);
3842
- if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {
3843
- this.notifyListeners(key, value);
3844
- keys.push(key);
3883
+ try {
3884
+ // TODO: check if we need to fallback if getAll is not supported
3885
+ const result = await this._withRetries((db) => {
3886
+ const getAllRequest = getObjectStore(db, false).getAll();
3887
+ return new DBPromise(getAllRequest).toPromise();
3888
+ });
3889
+ if (this.isHiding) {
3890
+ return [];
3891
+ }
3892
+ if (!result) {
3893
+ return [];
3894
+ }
3895
+ // If we have pending writes in progress abort, we'll get picked up on the next poll
3896
+ if (this.pendingWrites !== 0) {
3897
+ return [];
3898
+ }
3899
+ const keys = [];
3900
+ const keysInResult = new Set();
3901
+ if (result.length !== 0) {
3902
+ for (const { fbase_key: key, value } of result) {
3903
+ keysInResult.add(key);
3904
+ if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {
3905
+ this.notifyListeners(key, value);
3906
+ keys.push(key);
3907
+ }
3845
3908
  }
3846
3909
  }
3910
+ for (const localKey of Object.keys(this.localCache)) {
3911
+ if (this.localCache[localKey] && !keysInResult.has(localKey)) {
3912
+ // Deleted
3913
+ this.notifyListeners(localKey, null);
3914
+ keys.push(localKey);
3915
+ }
3916
+ }
3917
+ return keys;
3847
3918
  }
3848
- for (const localKey of Object.keys(this.localCache)) {
3849
- if (this.localCache[localKey] && !keysInResult.has(localKey)) {
3850
- // Deleted
3851
- this.notifyListeners(localKey, null);
3852
- keys.push(localKey);
3919
+ catch (e) {
3920
+ if (!this.isHiding) {
3921
+ _logWarn(`Firebase Auth cross-tab polling failed with error: ${e}`);
3853
3922
  }
3923
+ return [];
3854
3924
  }
3855
- return keys;
3856
3925
  }
3857
3926
  notifyListeners(key, newValue) {
3858
3927
  this.localCache[key] = newValue;
@@ -3876,6 +3945,7 @@ class IndexedDBLocalPersistence {
3876
3945
  _addListener(key, listener) {
3877
3946
  if (Object.keys(this.listeners).length === 0) {
3878
3947
  this.startPolling();
3948
+ this.registerLifecycleListeners();
3879
3949
  }
3880
3950
  if (!this.listeners[key]) {
3881
3951
  this.listeners[key] = new Set();
@@ -3893,6 +3963,7 @@ class IndexedDBLocalPersistence {
3893
3963
  }
3894
3964
  if (Object.keys(this.listeners).length === 0) {
3895
3965
  this.stopPolling();
3966
+ this.unregisterLifecycleListeners();
3896
3967
  }
3897
3968
  }
3898
3969
  }