@firebase/auth 1.13.1 → 1.13.2-eap-crashlytics.558ee841d

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 (62) hide show
  1. package/dist/browser-cjs/{index-58b444b9.js → index-223cb6d8.js} +55 -15
  2. package/dist/browser-cjs/index-223cb6d8.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/browser-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  6. package/dist/browser-cjs/test/helpers/mock_loadjs.d.ts +17 -0
  7. package/dist/cordova/index.js +2 -2
  8. package/dist/cordova/internal.js +2 -2
  9. package/dist/cordova/{popup_redirect-e90e6597.js → popup_redirect-8f954bab.js} +56 -16
  10. package/dist/cordova/popup_redirect-8f954bab.js.map +1 -0
  11. package/dist/cordova/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  12. package/dist/cordova/test/helpers/mock_loadjs.d.ts +17 -0
  13. package/dist/esm/{index-907e9a1a.js → index-42b2f63a.js} +56 -16
  14. package/dist/esm/index-42b2f63a.js.map +1 -0
  15. package/dist/esm/index.js +1 -1
  16. package/dist/esm/internal.js +2 -2
  17. package/dist/esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  18. package/dist/esm/test/helpers/mock_loadjs.d.ts +17 -0
  19. package/dist/index.webworker.js +55 -15
  20. package/dist/index.webworker.js.map +1 -1
  21. package/dist/node/index.js +1 -1
  22. package/dist/node/internal.js +1 -1
  23. package/dist/node/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  24. package/dist/node/test/helpers/mock_loadjs.d.ts +17 -0
  25. package/dist/node/{totp-ec1dc837.js → totp-1de3d98e.js} +39 -5
  26. package/dist/node/totp-1de3d98e.js.map +1 -0
  27. package/dist/node-esm/index.js +1 -1
  28. package/dist/node-esm/internal.js +2 -2
  29. package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  30. package/dist/node-esm/test/helpers/mock_loadjs.d.ts +17 -0
  31. package/dist/node-esm/{totp-97daafa8.js → totp-16b08ec9.js} +40 -6
  32. package/dist/node-esm/totp-16b08ec9.js.map +1 -0
  33. package/dist/rn/{index-ec5272bc.js → index-3c01bc90.js} +39 -5
  34. package/dist/rn/index-3c01bc90.js.map +1 -0
  35. package/dist/rn/index.js +1 -1
  36. package/dist/rn/internal.js +18 -12
  37. package/dist/rn/internal.js.map +1 -1
  38. package/dist/rn/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  39. package/dist/rn/test/helpers/mock_loadjs.d.ts +17 -0
  40. package/dist/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  41. package/dist/test/helpers/mock_loadjs.d.ts +17 -0
  42. package/dist/web-extension-cjs/index.js +1 -1
  43. package/dist/web-extension-cjs/internal.js +1 -1
  44. package/dist/web-extension-cjs/{register-410eef86.js → register-6a93d6fa.js} +55 -15
  45. package/dist/web-extension-cjs/register-6a93d6fa.js.map +1 -0
  46. package/dist/web-extension-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  47. package/dist/web-extension-cjs/test/helpers/mock_loadjs.d.ts +17 -0
  48. package/dist/web-extension-esm/index.js +2 -2
  49. package/dist/web-extension-esm/internal.js +2 -2
  50. package/dist/web-extension-esm/{register-4207f7c7.js → register-6e13f5d2.js} +56 -16
  51. package/dist/web-extension-esm/register-6e13f5d2.js.map +1 -0
  52. package/dist/web-extension-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
  53. package/dist/web-extension-esm/test/helpers/mock_loadjs.d.ts +17 -0
  54. package/package.json +6 -6
  55. package/dist/browser-cjs/index-58b444b9.js.map +0 -1
  56. package/dist/cordova/popup_redirect-e90e6597.js.map +0 -1
  57. package/dist/esm/index-907e9a1a.js.map +0 -1
  58. package/dist/node/totp-ec1dc837.js.map +0 -1
  59. package/dist/node-esm/totp-97daafa8.js.map +0 -1
  60. package/dist/rn/index-ec5272bc.js.map +0 -1
  61. package/dist/web-extension-cjs/register-410eef86.js.map +0 -1
  62. package/dist/web-extension-esm/register-4207f7c7.js.map +0 -1
@@ -19,12 +19,30 @@ import { Auth } from '../../model/public_types';
19
19
  import { AuthInternal } from '../../model/auth';
20
20
  export declare const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = "recaptcha-enterprise";
21
21
  export declare const FAKE_TOKEN = "NO_RECAPTCHA";
22
+ export declare const RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME = "onFirebaseAuthREInstanceReady";
23
+ declare global {
24
+ interface Window {
25
+ [RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]: () => void;
26
+ }
27
+ }
22
28
  export declare class RecaptchaEnterpriseVerifier {
23
29
  /**
24
30
  * Identifies the type of application verifier (e.g. "recaptcha-enterprise").
25
31
  */
26
32
  readonly type = "recaptcha-enterprise";
27
33
  private readonly auth;
34
+ /**
35
+ * Deferred that resolves when script tag has been injected onto the page
36
+ * and the script is ready (grecaptcha.ready() and script.onload are not
37
+ * reliable indicators, so this resolves when the global
38
+ * `window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]()` callback provided to the recaptcha url param "onload"
39
+ * is triggered).
40
+ * As a static variable this is applied to all instances of the class.
41
+ * This will cause an error if users try to create multiple RecaptchaVerifiers
42
+ * with different Recaptcha Enterprise sitekeys, which should be an
43
+ * unuspported use case.
44
+ */
45
+ private static scriptInjectionDeferred;
28
46
  /**
29
47
  *
30
48
  * @param authExtern - The corresponding Firebase {@link Auth} instance.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export declare const mockLoadJS: () => Promise<Event>;
@@ -1,5 +1,5 @@
1
- import { r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, c as connectAuthEmulator } from './register-4207f7c7.js';
2
- export { Y as ActionCodeURL, m as AuthCredential, A as AuthErrorCodes, E as EmailAuthCredential, q as EmailAuthProvider, F as FacebookAuthProvider, t as GithubAuthProvider, G as GoogleAuthProvider, O as OAuthCredential, w as OAuthProvider, P as PhoneAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, b as TotpSecret, x as TwitterAuthProvider, J as applyActionCode, e as beforeAuthStateChanged, K as checkActionCode, I as confirmPasswordReset, c as connectAuthEmulator, M as createUserWithEmailAndPassword, l as debugErrorMap, k as deleteUser, V as fetchSignInMethodsForEmail, a4 as getAdditionalUserInfo, a1 as getIdToken, a2 as getIdTokenResult, a6 as getMultiFactorResolver, n as inMemoryPersistence, a as indexedDBLocalPersistence, i as initializeAuth, d as initializeRecaptchaConfig, R as isSignInWithEmailLink, B as linkWithCredential, a7 as multiFactor, f as onAuthStateChanged, o as onIdTokenChanged, Z as parseActionCodeURL, p as prodErrorMap, C as reauthenticateWithCredential, a5 as reload, j as revokeAccessToken, W as sendEmailVerification, H as sendPasswordResetEmail, Q as sendSignInLinkToEmail, s as setPersistence, y as signInAnonymously, z as signInWithCredential, D as signInWithCustomToken, N as signInWithEmailAndPassword, U as signInWithEmailLink, h as signOut, a3 as unlink, g as updateCurrentUser, $ as updateEmail, a0 as updatePassword, _ as updateProfile, u as useDeviceLanguage, v as validatePassword, X as verifyBeforeUpdateEmail, L as verifyPasswordResetCode } from './register-4207f7c7.js';
1
+ import { r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, c as connectAuthEmulator } from './register-6e13f5d2.js';
2
+ export { Y as ActionCodeURL, m as AuthCredential, A as AuthErrorCodes, E as EmailAuthCredential, q as EmailAuthProvider, F as FacebookAuthProvider, t as GithubAuthProvider, G as GoogleAuthProvider, O as OAuthCredential, w as OAuthProvider, P as PhoneAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, b as TotpSecret, x as TwitterAuthProvider, J as applyActionCode, e as beforeAuthStateChanged, K as checkActionCode, I as confirmPasswordReset, c as connectAuthEmulator, M as createUserWithEmailAndPassword, l as debugErrorMap, k as deleteUser, V as fetchSignInMethodsForEmail, a4 as getAdditionalUserInfo, a1 as getIdToken, a2 as getIdTokenResult, a6 as getMultiFactorResolver, n as inMemoryPersistence, a as indexedDBLocalPersistence, i as initializeAuth, d as initializeRecaptchaConfig, R as isSignInWithEmailLink, B as linkWithCredential, a7 as multiFactor, f as onAuthStateChanged, o as onIdTokenChanged, Z as parseActionCodeURL, p as prodErrorMap, C as reauthenticateWithCredential, a5 as reload, j as revokeAccessToken, W as sendEmailVerification, H as sendPasswordResetEmail, Q as sendSignInLinkToEmail, s as setPersistence, y as signInAnonymously, z as signInWithCredential, D as signInWithCustomToken, N as signInWithEmailAndPassword, U as signInWithEmailLink, h as signOut, a3 as unlink, g as updateCurrentUser, $ as updateEmail, a0 as updatePassword, _ as updateProfile, u as useDeviceLanguage, v as validatePassword, X as verifyBeforeUpdateEmail, L as verifyPasswordResetCode } from './register-6e13f5d2.js';
3
3
  import { _getProvider, getApp } from '@firebase/app';
4
4
  import { getDefaultEmulatorHost } from '@firebase/util';
5
5
  import '@firebase/component';
@@ -1,5 +1,5 @@
1
- import { a8 as STORAGE_AVAILABLE_KEY, a9 as _isMobileBrowser, aa as _isIE10, ab as Delay, ac as _window, ad as _assert, ae as isV2, af as _createError, ag as _recaptchaV2ScriptUrl, ah as _loadJS, ai as MockReCaptcha, aj as _generateCallbackName, ak as _castAuth, al as _isHttpOrHttps, am as _isWorker, an as getRecaptchaParams, ao as _serverAppCurrentUserOperationNotSupportedError, z as signInWithCredential, ap as _assertLinkedStatus, B as linkWithCredential, C as reauthenticateWithCredential, aq as _initializeRecaptchaConfig, ar as FAKE_TOKEN, as as startEnrollPhoneMfa, at as handleRecaptchaFlow, au as startSignInPhoneMfa, av as sendPhoneVerificationCode, aw as _link$1, P as PhoneAuthCredential, ax as _getInstance, ay as _signInWithCredential, az as _reauthenticate, m as AuthCredential, aA as signInWithIdp, aB as _fail, aC as debugAssert, aD as _assertInstanceOf, aE as _generateEventId, aF as FederatedAuthProvider, aG as _persistenceKeyName, aH as _performApiRequest, aI as _getCurrentUrl, aJ as _gapiScriptUrl, aK as _emulatorUrl, aL as _isChromeIOS, aM as _isFirefox, aN as _isIOSStandalone, aO as BaseOAuthProvider, aP as _setWindowLocation, aQ as _isSafari, aR as _isIOS, aS as MultiFactorAssertionImpl, aT as finalizeEnrollPhoneMfa, aU as finalizeSignInPhoneMfa, r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, e as beforeAuthStateChanged, o as onIdTokenChanged, c as connectAuthEmulator, aV as _setExternalJSProvider, aW as _isAndroid, aX as _isIOS7Or8 } from './register-4207f7c7.js';
2
- export { Y as ActionCodeURL, m as AuthCredential, A as AuthErrorCodes, aZ as AuthImpl, E as EmailAuthCredential, q as EmailAuthProvider, F as FacebookAuthProvider, a$ as FetchProvider, t as GithubAuthProvider, G as GoogleAuthProvider, O as OAuthCredential, w as OAuthProvider, P as PhoneAuthCredential, b0 as SAMLAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, b as TotpSecret, x as TwitterAuthProvider, aY as UserImpl, ad as _assert, ak as _castAuth, aB as _fail, aE as _generateEventId, a_ as _getClientVersion, ax as _getInstance, aG as _persistenceKeyName, J as applyActionCode, e as beforeAuthStateChanged, K as checkActionCode, I as confirmPasswordReset, c as connectAuthEmulator, M as createUserWithEmailAndPassword, l as debugErrorMap, k as deleteUser, V as fetchSignInMethodsForEmail, a4 as getAdditionalUserInfo, a1 as getIdToken, a2 as getIdTokenResult, a6 as getMultiFactorResolver, n as inMemoryPersistence, a as indexedDBLocalPersistence, i as initializeAuth, d as initializeRecaptchaConfig, R as isSignInWithEmailLink, B as linkWithCredential, a7 as multiFactor, f as onAuthStateChanged, o as onIdTokenChanged, Z as parseActionCodeURL, p as prodErrorMap, C as reauthenticateWithCredential, a5 as reload, j as revokeAccessToken, W as sendEmailVerification, H as sendPasswordResetEmail, Q as sendSignInLinkToEmail, s as setPersistence, y as signInAnonymously, z as signInWithCredential, D as signInWithCustomToken, N as signInWithEmailAndPassword, U as signInWithEmailLink, h as signOut, a3 as unlink, g as updateCurrentUser, $ as updateEmail, a0 as updatePassword, _ as updateProfile, u as useDeviceLanguage, v as validatePassword, X as verifyBeforeUpdateEmail, L as verifyPasswordResetCode } from './register-4207f7c7.js';
1
+ import { a8 as STORAGE_AVAILABLE_KEY, a9 as _isMobileBrowser, aa as _isIE10, ab as Delay, ac as _window, ad as _assert, ae as isV2, af as _createError, ag as _recaptchaV2ScriptUrl, ah as _loadJS, ai as MockReCaptcha, aj as _generateCallbackName, ak as _castAuth, al as _isHttpOrHttps, am as _isWorker, an as getRecaptchaParams, ao as _serverAppCurrentUserOperationNotSupportedError, z as signInWithCredential, ap as _assertLinkedStatus, B as linkWithCredential, C as reauthenticateWithCredential, aq as _initializeRecaptchaConfig, ar as FAKE_TOKEN, as as startEnrollPhoneMfa, at as handleRecaptchaFlow, au as startSignInPhoneMfa, av as sendPhoneVerificationCode, aw as _link$1, P as PhoneAuthCredential, ax as _getInstance, ay as _signInWithCredential, az as _reauthenticate, m as AuthCredential, aA as signInWithIdp, aB as _fail, aC as debugAssert, aD as _assertInstanceOf, aE as _generateEventId, aF as FederatedAuthProvider, aG as _persistenceKeyName, aH as _performApiRequest, aI as _getCurrentUrl, aJ as _gapiScriptUrl, aK as _emulatorUrl, aL as _isChromeIOS, aM as _isFirefox, aN as _isIOSStandalone, aO as BaseOAuthProvider, aP as _setWindowLocation, aQ as _isSafari, aR as _isIOS, aS as MultiFactorAssertionImpl, aT as finalizeEnrollPhoneMfa, aU as finalizeSignInPhoneMfa, r as registerAuth, i as initializeAuth, a as indexedDBLocalPersistence, e as beforeAuthStateChanged, o as onIdTokenChanged, c as connectAuthEmulator, aV as _setExternalJSProvider, aW as _isAndroid, aX as _isIOS7Or8 } from './register-6e13f5d2.js';
2
+ export { Y as ActionCodeURL, m as AuthCredential, A as AuthErrorCodes, aZ as AuthImpl, E as EmailAuthCredential, q as EmailAuthProvider, F as FacebookAuthProvider, a$ as FetchProvider, t as GithubAuthProvider, G as GoogleAuthProvider, O as OAuthCredential, w as OAuthProvider, P as PhoneAuthCredential, b0 as SAMLAuthCredential, S as SAMLAuthProvider, T as TotpMultiFactorGenerator, b as TotpSecret, x as TwitterAuthProvider, aY as UserImpl, ad as _assert, ak as _castAuth, aB as _fail, aE as _generateEventId, a_ as _getClientVersion, ax as _getInstance, aG as _persistenceKeyName, J as applyActionCode, e as beforeAuthStateChanged, K as checkActionCode, I as confirmPasswordReset, c as connectAuthEmulator, M as createUserWithEmailAndPassword, l as debugErrorMap, k as deleteUser, V as fetchSignInMethodsForEmail, a4 as getAdditionalUserInfo, a1 as getIdToken, a2 as getIdTokenResult, a6 as getMultiFactorResolver, n as inMemoryPersistence, a as indexedDBLocalPersistence, i as initializeAuth, d as initializeRecaptchaConfig, R as isSignInWithEmailLink, B as linkWithCredential, a7 as multiFactor, f as onAuthStateChanged, o as onIdTokenChanged, Z as parseActionCodeURL, p as prodErrorMap, C as reauthenticateWithCredential, a5 as reload, j as revokeAccessToken, W as sendEmailVerification, H as sendPasswordResetEmail, Q as sendSignInLinkToEmail, s as setPersistence, y as signInAnonymously, z as signInWithCredential, D as signInWithCustomToken, N as signInWithEmailAndPassword, U as signInWithEmailLink, h as signOut, a3 as unlink, g as updateCurrentUser, $ as updateEmail, a0 as updatePassword, _ as updateProfile, u as useDeviceLanguage, v as validatePassword, X as verifyBeforeUpdateEmail, L as verifyPasswordResetCode } from './register-6e13f5d2.js';
3
3
  import { querystring, getModularInstance, getUA, isEmpty, getExperimentalSetting, getDefaultEmulatorHost, querystringDecode } from '@firebase/util';
4
4
  import { _isFirebaseServerApp, SDK_VERSION, _getProvider, getApp } from '@firebase/app';
5
5
  import '@firebase/component';
@@ -1,4 +1,4 @@
1
- import { ErrorFactory, isBrowserExtension, isMobileCordova, isReactNative, FirebaseError, querystring, isCloudflareWorker, isCloudWorkstation, getModularInstance, base64Decode, getUA, isIE, createSubscribe, deepEqual, pingServer, querystringDecode, extractQuerystring } from '@firebase/util';
1
+ import { ErrorFactory, isBrowserExtension, isMobileCordova, isReactNative, FirebaseError, querystring, isCloudflareWorker, isCloudWorkstation, getModularInstance, base64Decode, getUA, isIE, createSubscribe, Deferred, deepEqual, pingServer, querystringDecode, extractQuerystring } from '@firebase/util';
2
2
  import { SDK_VERSION, _isFirebaseServerApp, _getProvider, _registerComponent, registerVersion } from '@firebase/app';
3
3
  import { Component } from '@firebase/component';
4
4
  import { Logger, LogLevel } from '@firebase/logger';
@@ -3330,6 +3330,7 @@ function generateRandomAlphaNumericString(len) {
3330
3330
  /* eslint-disable @typescript-eslint/no-require-imports */
3331
3331
  const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = 'recaptcha-enterprise';
3332
3332
  const FAKE_TOKEN = 'NO_RECAPTCHA';
3333
+ const RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME = 'onFirebaseAuthREInstanceReady';
3333
3334
  class RecaptchaEnterpriseVerifier {
3334
3335
  /**
3335
3336
  *
@@ -3409,8 +3410,13 @@ class RecaptchaEnterpriseVerifier {
3409
3410
  }
3410
3411
  return new Promise((resolve, reject) => {
3411
3412
  retrieveSiteKey(this.auth)
3412
- .then(siteKey => {
3413
- if (!forceRefresh && isEnterprise(window.grecaptcha)) {
3413
+ .then(async (siteKey) => {
3414
+ if (!forceRefresh &&
3415
+ isEnterprise(window.grecaptcha) &&
3416
+ // If download has already been initiated, do not trigger another
3417
+ // download, await the promise here.
3418
+ RecaptchaEnterpriseVerifier.scriptInjectionDeferred) {
3419
+ await RecaptchaEnterpriseVerifier.scriptInjectionDeferred.promise;
3414
3420
  retrieveRecaptchaToken(siteKey, resolve, reject);
3415
3421
  }
3416
3422
  else {
@@ -3420,9 +3426,25 @@ class RecaptchaEnterpriseVerifier {
3420
3426
  }
3421
3427
  let url = _recaptchaEnterpriseScriptUrl();
3422
3428
  if (url.length !== 0) {
3423
- url += siteKey;
3429
+ url +=
3430
+ siteKey +
3431
+ `&onload=${RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME}`;
3424
3432
  }
3433
+ // Existence of deferred indicates download has been initiated.
3434
+ RecaptchaEnterpriseVerifier.scriptInjectionDeferred =
3435
+ new Deferred();
3436
+ /**
3437
+ * Script attached to global window object that will be called
3438
+ * when the ReCAPTCHA Enterprise instance is ready.
3439
+ * grecaptcha.ready() is not reliable when there are multiple
3440
+ * scripts on the page, and script.onload only indicates the
3441
+ * script has downloaded, not that it has initialized.
3442
+ */
3443
+ window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME] = () => {
3444
+ RecaptchaEnterpriseVerifier.scriptInjectionDeferred?.resolve();
3445
+ };
3425
3446
  _loadJS(url)
3447
+ .then(() => RecaptchaEnterpriseVerifier.scriptInjectionDeferred?.promise)
3426
3448
  .then(() => {
3427
3449
  retrieveRecaptchaToken(siteKey, resolve, reject);
3428
3450
  })
@@ -3437,6 +3459,18 @@ class RecaptchaEnterpriseVerifier {
3437
3459
  });
3438
3460
  }
3439
3461
  }
3462
+ /**
3463
+ * Deferred that resolves when script tag has been injected onto the page
3464
+ * and the script is ready (grecaptcha.ready() and script.onload are not
3465
+ * reliable indicators, so this resolves when the global
3466
+ * `window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]()` callback provided to the recaptcha url param "onload"
3467
+ * is triggered).
3468
+ * As a static variable this is applied to all instances of the class.
3469
+ * This will cause an error if users try to create multiple RecaptchaVerifiers
3470
+ * with different Recaptcha Enterprise sitekeys, which should be an
3471
+ * unuspported use case.
3472
+ */
3473
+ RecaptchaEnterpriseVerifier.scriptInjectionDeferred = null;
3440
3474
  async function injectRecaptchaFields(auth, request, action, isCaptchaResp = false, isFakeToken = false) {
3441
3475
  const verifier = new RecaptchaEnterpriseVerifier(auth);
3442
3476
  let captchaResponse;
@@ -7676,6 +7710,7 @@ const _TRANSACTION_RETRY_COUNT = 3;
7676
7710
  class IndexedDBLocalPersistence {
7677
7711
  constructor() {
7678
7712
  this.type = "LOCAL" /* PersistenceType.LOCAL */;
7713
+ this.dbPromise = null;
7679
7714
  this._shouldAllowMigration = true;
7680
7715
  this.listeners = {};
7681
7716
  this.localCache = {};
@@ -7692,11 +7727,14 @@ class IndexedDBLocalPersistence {
7692
7727
  this.initializeServiceWorkerMessaging().then(() => { }, () => { });
7693
7728
  }
7694
7729
  async _openDb() {
7695
- if (this.db) {
7696
- return this.db;
7730
+ if (this.dbPromise) {
7731
+ return this.dbPromise;
7697
7732
  }
7698
- this.db = await _openDatabase();
7699
- return this.db;
7733
+ this.dbPromise = _openDatabase();
7734
+ this.dbPromise.catch(() => {
7735
+ this.dbPromise = null;
7736
+ });
7737
+ return this.dbPromise;
7700
7738
  }
7701
7739
  async _withRetries(op) {
7702
7740
  let numAttempts = 0;
@@ -7709,9 +7747,10 @@ class IndexedDBLocalPersistence {
7709
7747
  if (numAttempts++ > _TRANSACTION_RETRY_COUNT) {
7710
7748
  throw e;
7711
7749
  }
7712
- if (this.db) {
7713
- this.db.close();
7714
- this.db = undefined;
7750
+ if (this.dbPromise) {
7751
+ const db = await this.dbPromise;
7752
+ db.close();
7753
+ this.dbPromise = null;
7715
7754
  }
7716
7755
  // TODO: consider adding exponential backoff
7717
7756
  }
@@ -7796,9 +7835,10 @@ class IndexedDBLocalPersistence {
7796
7835
  if (!indexedDB) {
7797
7836
  return false;
7798
7837
  }
7799
- const db = await _openDatabase();
7800
- await _putObject(db, STORAGE_AVAILABLE_KEY, '1');
7801
- await _deleteObject(db, STORAGE_AVAILABLE_KEY);
7838
+ await this._withRetries(async (db) => {
7839
+ await _putObject(db, STORAGE_AVAILABLE_KEY, '1');
7840
+ await _deleteObject(db, STORAGE_AVAILABLE_KEY);
7841
+ });
7802
7842
  return true;
7803
7843
  }
7804
7844
  catch { }
@@ -8105,7 +8145,7 @@ function _isEmptyString(input) {
8105
8145
  }
8106
8146
 
8107
8147
  var name = "@firebase/auth";
8108
- var version = "1.13.1";
8148
+ var version = "1.13.2-eap-crashlytics.558ee841d";
8109
8149
 
8110
8150
  /**
8111
8151
  * @license
@@ -8251,4 +8291,4 @@ function registerAuth(clientPlatform) {
8251
8291
  }
8252
8292
 
8253
8293
  export { updateEmail as $, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as A, linkWithCredential as B, reauthenticateWithCredential as C, signInWithCustomToken as D, EmailAuthCredential as E, FacebookAuthProvider as F, GoogleAuthProvider as G, sendPasswordResetEmail as H, confirmPasswordReset as I, applyActionCode as J, checkActionCode as K, verifyPasswordResetCode as L, createUserWithEmailAndPassword as M, signInWithEmailAndPassword as N, OAuthCredential as O, PhoneAuthCredential as P, sendSignInLinkToEmail as Q, isSignInWithEmailLink as R, SAMLAuthProvider as S, TotpMultiFactorGenerator as T, signInWithEmailLink as U, fetchSignInMethodsForEmail as V, sendEmailVerification as W, verifyBeforeUpdateEmail as X, ActionCodeURL as Y, parseActionCodeURL as Z, updateProfile as _, indexedDBLocalPersistence as a, FetchProvider as a$, updatePassword as a0, getIdToken as a1, getIdTokenResult as a2, unlink as a3, getAdditionalUserInfo as a4, reload as a5, getMultiFactorResolver as a6, multiFactor as a7, STORAGE_AVAILABLE_KEY as a8, _isMobileBrowser as a9, signInWithIdp as aA, _fail as aB, debugAssert as aC, _assertInstanceOf as aD, _generateEventId as aE, FederatedAuthProvider as aF, _persistenceKeyName as aG, _performApiRequest as aH, _getCurrentUrl as aI, _gapiScriptUrl as aJ, _emulatorUrl as aK, _isChromeIOS as aL, _isFirefox as aM, _isIOSStandalone as aN, BaseOAuthProvider as aO, _setWindowLocation as aP, _isSafari as aQ, _isIOS as aR, MultiFactorAssertionImpl as aS, finalizeEnrollPhoneMfa as aT, finalizeSignInPhoneMfa as aU, _setExternalJSProvider as aV, _isAndroid as aW, _isIOS7Or8 as aX, UserImpl as aY, AuthImpl as aZ, _getClientVersion as a_, _isIE10 as aa, Delay as ab, _window as ac, _assert as ad, isV2 as ae, _createError as af, _recaptchaV2ScriptUrl as ag, _loadJS as ah, MockReCaptcha as ai, _generateCallbackName as aj, _castAuth as ak, _isHttpOrHttps as al, _isWorker as am, getRecaptchaParams as an, _serverAppCurrentUserOperationNotSupportedError as ao, _assertLinkedStatus as ap, _initializeRecaptchaConfig as aq, FAKE_TOKEN as ar, startEnrollPhoneMfa as as, handleRecaptchaFlow as at, startSignInPhoneMfa as au, sendPhoneVerificationCode as av, _link as aw, _getInstance as ax, _signInWithCredential as ay, _reauthenticate as az, TotpSecret as b, SAMLAuthCredential as b0, connectAuthEmulator as c, initializeRecaptchaConfig as d, beforeAuthStateChanged as e, onAuthStateChanged as f, updateCurrentUser as g, signOut as h, initializeAuth as i, revokeAccessToken as j, deleteUser as k, debugErrorMap as l, AuthCredential as m, inMemoryPersistence as n, onIdTokenChanged as o, prodErrorMap as p, EmailAuthProvider as q, registerAuth as r, setPersistence as s, GithubAuthProvider as t, useDeviceLanguage as u, validatePassword as v, OAuthProvider as w, TwitterAuthProvider as x, signInAnonymously as y, signInWithCredential as z };
8254
- //# sourceMappingURL=register-4207f7c7.js.map
8294
+ //# sourceMappingURL=register-6e13f5d2.js.map