@firebase/auth 1.9.0 → 1.9.1-20250214170153

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 (43) hide show
  1. package/dist/browser-cjs/{index-16d8b41f.js → index-782b1901.js} +20 -6
  2. package/dist/browser-cjs/index-782b1901.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/{popup_redirect-0008fafa.js → popup_redirect-bb14be2b.js} +21 -7
  8. package/dist/cordova/popup_redirect-bb14be2b.js.map +1 -0
  9. package/dist/esm2017/{index-dfc2d82f.js → index-10f14d74.js} +20 -6
  10. package/dist/esm2017/index-10f14d74.js.map +1 -0
  11. package/dist/esm2017/index.js +1 -1
  12. package/dist/esm2017/internal.js +2 -2
  13. package/dist/index.webworker.js +19 -5
  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-878dabb4.js → totp-72165c3c.js} +20 -6
  18. package/dist/node/totp-72165c3c.js.map +1 -0
  19. package/dist/node-esm/index.js +1 -1
  20. package/dist/node-esm/internal.js +2 -2
  21. package/dist/node-esm/{totp-fb613490.js → totp-d0a02309.js} +20 -6
  22. package/dist/node-esm/totp-d0a02309.js.map +1 -0
  23. package/dist/rn/{index-5b4d4361.js → index-2b19416f.js} +21 -7
  24. package/dist/rn/index-2b19416f.js.map +1 -0
  25. package/dist/rn/index.js +1 -1
  26. package/dist/rn/internal.js +1 -1
  27. package/dist/web-extension-cjs/index.js +1 -1
  28. package/dist/web-extension-cjs/internal.js +1 -1
  29. package/dist/web-extension-cjs/{register-a7850952.js → register-c9b5f5d2.js} +21 -7
  30. package/dist/web-extension-cjs/register-c9b5f5d2.js.map +1 -0
  31. package/dist/web-extension-esm2017/index.js +2 -2
  32. package/dist/web-extension-esm2017/internal.js +2 -2
  33. package/dist/web-extension-esm2017/{register-5e33eb62.js → register-fa673756.js} +21 -7
  34. package/dist/web-extension-esm2017/register-fa673756.js.map +1 -0
  35. package/package.json +2 -2
  36. package/dist/browser-cjs/index-16d8b41f.js.map +0 -1
  37. package/dist/cordova/popup_redirect-0008fafa.js.map +0 -1
  38. package/dist/esm2017/index-dfc2d82f.js.map +0 -1
  39. package/dist/node/totp-878dabb4.js.map +0 -1
  40. package/dist/node-esm/totp-fb613490.js.map +0 -1
  41. package/dist/rn/index-5b4d4361.js.map +0 -1
  42. package/dist/web-extension-cjs/register-a7850952.js.map +0 -1
  43. package/dist/web-extension-esm2017/register-5e33eb62.js.map +0 -1
@@ -3692,21 +3692,35 @@ function _initializeAuthInstance(auth, deps) {
3692
3692
  */
3693
3693
  function connectAuthEmulator(auth, url, options) {
3694
3694
  const authInternal = _castAuth(auth);
3695
- _assert(authInternal._canInitEmulator, authInternal, "emulator-config-failed" /* AuthErrorCode.EMULATOR_CONFIG_FAILED */);
3696
3695
  _assert(/^https?:\/\//.test(url), authInternal, "invalid-emulator-scheme" /* AuthErrorCode.INVALID_EMULATOR_SCHEME */);
3697
3696
  const disableWarnings = !!(options === null || options === void 0 ? void 0 : options.disableWarnings);
3698
3697
  const protocol = extractProtocol(url);
3699
3698
  const { host, port } = extractHostAndPort(url);
3700
3699
  const portStr = port === null ? '' : `:${port}`;
3701
3700
  // Always replace path with "/" (even if input url had no path at all, or had a different one).
3702
- authInternal.config.emulator = { url: `${protocol}//${host}${portStr}/` };
3703
- authInternal.settings.appVerificationDisabledForTesting = true;
3704
- authInternal.emulatorConfig = Object.freeze({
3701
+ const emulator = { url: `${protocol}//${host}${portStr}/` };
3702
+ const emulatorConfig = Object.freeze({
3705
3703
  host,
3706
3704
  port,
3707
3705
  protocol: protocol.replace(':', ''),
3708
3706
  options: Object.freeze({ disableWarnings })
3709
3707
  });
3708
+ // There are a few scenarios to guard against if the Auth instance has already started:
3709
+ if (!authInternal._canInitEmulator) {
3710
+ // Applications may not initialize the emulator for the first time if Auth has already started
3711
+ // to make network requests.
3712
+ _assert(authInternal.config.emulator && authInternal.emulatorConfig, authInternal, "emulator-config-failed" /* AuthErrorCode.EMULATOR_CONFIG_FAILED */);
3713
+ // Applications may not alter the configuration of the emulator (aka pass a different config)
3714
+ // once Auth has started to make network requests.
3715
+ _assert(util.deepEqual(emulator, authInternal.config.emulator) &&
3716
+ util.deepEqual(emulatorConfig, authInternal.emulatorConfig), authInternal, "emulator-config-failed" /* AuthErrorCode.EMULATOR_CONFIG_FAILED */);
3717
+ // It's valid, however, to invoke connectAuthEmulator() after Auth has started making
3718
+ // connections, so long as the config matches the existing config. This results in a no-op.
3719
+ return;
3720
+ }
3721
+ authInternal.config.emulator = emulator;
3722
+ authInternal.emulatorConfig = emulatorConfig;
3723
+ authInternal.settings.appVerificationDisabledForTesting = true;
3710
3724
  if (!disableWarnings) {
3711
3725
  emitEmulatorWarning();
3712
3726
  }
@@ -10667,7 +10681,7 @@ function _isEmptyString(input) {
10667
10681
  }
10668
10682
 
10669
10683
  var name = "@firebase/auth";
10670
- var version = "1.9.0";
10684
+ var version = "1.9.1-20250214170153";
10671
10685
 
10672
10686
  /**
10673
10687
  * @license
@@ -11028,4 +11042,4 @@ exports.useDeviceLanguage = useDeviceLanguage;
11028
11042
  exports.validatePassword = validatePassword;
11029
11043
  exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
11030
11044
  exports.verifyPasswordResetCode = verifyPasswordResetCode;
11031
- //# sourceMappingURL=index-16d8b41f.js.map
11045
+ //# sourceMappingURL=index-782b1901.js.map