@firebase/auth 1.9.0-canary.70e08cf95 → 1.9.0-canary.84dfeca39

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-a7b19ebb.js → index-fc894b65.js} +20 -6
  2. package/dist/browser-cjs/index-fc894b65.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-bcf14849.js → popup_redirect-bb89320d.js} +21 -7
  8. package/dist/cordova/popup_redirect-bb89320d.js.map +1 -0
  9. package/dist/esm2017/{index-4f54a18c.js → index-7e0263ea.js} +20 -6
  10. package/dist/esm2017/index-7e0263ea.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-53b63107.js → totp-f104a2de.js} +20 -6
  18. package/dist/node/totp-f104a2de.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-0d7d88e7.js → totp-3f85c5bc.js} +20 -6
  22. package/dist/node-esm/totp-3f85c5bc.js.map +1 -0
  23. package/dist/rn/{index-a23f7ff5.js → index-35b10c54.js} +21 -7
  24. package/dist/rn/index-35b10c54.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-b62bf59f.js → register-495a4024.js} +21 -7
  30. package/dist/web-extension-cjs/register-495a4024.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-99d7b62c.js → register-29fee46c.js} +21 -7
  34. package/dist/web-extension-esm2017/register-29fee46c.js.map +1 -0
  35. package/package.json +6 -6
  36. package/dist/browser-cjs/index-a7b19ebb.js.map +0 -1
  37. package/dist/cordova/popup_redirect-bcf14849.js.map +0 -1
  38. package/dist/esm2017/index-4f54a18c.js.map +0 -1
  39. package/dist/node/totp-53b63107.js.map +0 -1
  40. package/dist/node-esm/totp-0d7d88e7.js.map +0 -1
  41. package/dist/rn/index-a23f7ff5.js.map +0 -1
  42. package/dist/web-extension-cjs/register-b62bf59f.js.map +0 -1
  43. package/dist/web-extension-esm2017/register-99d7b62c.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var totp = require('./totp-53b63107.js');
5
+ var totp = require('./totp-f104a2de.js');
6
6
  require('@firebase/app');
7
7
  require('@firebase/util');
8
8
  require('tslib');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var totp = require('./totp-53b63107.js');
5
+ var totp = require('./totp-f104a2de.js');
6
6
  var util = require('@firebase/util');
7
7
  require('tslib');
8
8
  var app = require('@firebase/app');
@@ -3548,21 +3548,35 @@ function _initializeAuthInstance(auth, deps) {
3548
3548
  */
3549
3549
  function connectAuthEmulator(auth, url, options) {
3550
3550
  const authInternal = _castAuth(auth);
3551
- _assert(authInternal._canInitEmulator, authInternal, "emulator-config-failed" /* AuthErrorCode.EMULATOR_CONFIG_FAILED */);
3552
3551
  _assert(/^https?:\/\//.test(url), authInternal, "invalid-emulator-scheme" /* AuthErrorCode.INVALID_EMULATOR_SCHEME */);
3553
3552
  const disableWarnings = !!(options === null || options === void 0 ? void 0 : options.disableWarnings);
3554
3553
  const protocol = extractProtocol(url);
3555
3554
  const { host, port } = extractHostAndPort(url);
3556
3555
  const portStr = port === null ? '' : `:${port}`;
3557
3556
  // Always replace path with "/" (even if input url had no path at all, or had a different one).
3558
- authInternal.config.emulator = { url: `${protocol}//${host}${portStr}/` };
3559
- authInternal.settings.appVerificationDisabledForTesting = true;
3560
- authInternal.emulatorConfig = Object.freeze({
3557
+ const emulator = { url: `${protocol}//${host}${portStr}/` };
3558
+ const emulatorConfig = Object.freeze({
3561
3559
  host,
3562
3560
  port,
3563
3561
  protocol: protocol.replace(':', ''),
3564
3562
  options: Object.freeze({ disableWarnings })
3565
3563
  });
3564
+ // There are a few scenarios to guard against if the Auth instance has already started:
3565
+ if (!authInternal._canInitEmulator) {
3566
+ // Applications may not initialize the emulator for the first time if Auth has already started
3567
+ // to make network requests.
3568
+ _assert(authInternal.config.emulator && authInternal.emulatorConfig, authInternal, "emulator-config-failed" /* AuthErrorCode.EMULATOR_CONFIG_FAILED */);
3569
+ // Applications may not alter the configuration of the emulator (aka pass a different config)
3570
+ // once Auth has started to make network requests.
3571
+ _assert(util.deepEqual(emulator, authInternal.config.emulator) &&
3572
+ util.deepEqual(emulatorConfig, authInternal.emulatorConfig), authInternal, "emulator-config-failed" /* AuthErrorCode.EMULATOR_CONFIG_FAILED */);
3573
+ // It's valid, however, to invoke connectAuthEmulator() after Auth has started making
3574
+ // connections, so long as the config matches the existing config. This results in a no-op.
3575
+ return;
3576
+ }
3577
+ authInternal.config.emulator = emulator;
3578
+ authInternal.emulatorConfig = emulatorConfig;
3579
+ authInternal.settings.appVerificationDisabledForTesting = true;
3566
3580
  if (!disableWarnings) {
3567
3581
  emitEmulatorWarning();
3568
3582
  }
@@ -7067,7 +7081,7 @@ function multiFactor(user) {
7067
7081
  }
7068
7082
 
7069
7083
  var name = "@firebase/auth";
7070
- var version = "1.9.0-canary.70e08cf95";
7084
+ var version = "1.9.0-canary.84dfeca39";
7071
7085
 
7072
7086
  /**
7073
7087
  * @license
@@ -7588,4 +7602,4 @@ exports.useDeviceLanguage = useDeviceLanguage;
7588
7602
  exports.validatePassword = validatePassword;
7589
7603
  exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
7590
7604
  exports.verifyPasswordResetCode = verifyPasswordResetCode;
7591
- //# sourceMappingURL=totp-53b63107.js.map
7605
+ //# sourceMappingURL=totp-f104a2de.js.map