@firebase/auth 0.20.3 → 0.20.4-canary.13550089f

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 (51) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/auth-public.d.ts +1 -1
  3. package/dist/auth.d.ts +1 -1
  4. package/dist/cordova/index.js +2 -2
  5. package/dist/cordova/internal.js +12 -5
  6. package/dist/cordova/internal.js.map +1 -1
  7. package/dist/cordova/{popup_redirect-9ed330a1.js → popup_redirect-fcb18d0f.js} +40 -34
  8. package/dist/cordova/popup_redirect-fcb18d0f.js.map +1 -0
  9. package/dist/cordova/src/platform_browser/providers/phone.d.ts +1 -1
  10. package/dist/cordova/src/platform_browser/recaptcha/recaptcha_loader.d.ts +5 -0
  11. package/dist/esm2017/{index-69ab4e3a.js → index-25da8a76.js} +24 -11
  12. package/dist/esm2017/index-25da8a76.js.map +1 -0
  13. package/dist/esm2017/index.js +1 -1
  14. package/dist/esm2017/internal.js +2 -2
  15. package/dist/esm2017/src/platform_browser/providers/phone.d.ts +1 -1
  16. package/dist/esm2017/src/platform_browser/recaptcha/recaptcha_loader.d.ts +5 -0
  17. package/dist/esm5/{index-81005f8a.js → index-66b1cbdf.js} +50 -37
  18. package/dist/esm5/index-66b1cbdf.js.map +1 -0
  19. package/dist/esm5/index.js +1 -1
  20. package/dist/esm5/internal.js +2 -2
  21. package/dist/esm5/src/platform_browser/providers/phone.d.ts +1 -1
  22. package/dist/esm5/src/platform_browser/recaptcha/recaptcha_loader.d.ts +5 -0
  23. package/dist/index.webworker.esm5.js +37 -32
  24. package/dist/index.webworker.esm5.js.map +1 -1
  25. package/dist/node/{index-007f80f6.js → index-1d7eab4e.js} +40 -34
  26. package/dist/node/index-1d7eab4e.js.map +1 -0
  27. package/dist/node/index.js +1 -1
  28. package/dist/node/internal.js +1 -1
  29. package/dist/node/src/platform_browser/providers/phone.d.ts +1 -1
  30. package/dist/node/src/platform_browser/recaptcha/recaptcha_loader.d.ts +5 -0
  31. package/dist/node-esm/{index-b1f59f63.js → index-f6d42709.js} +14 -8
  32. package/dist/node-esm/index-f6d42709.js.map +1 -0
  33. package/dist/node-esm/index.js +1 -1
  34. package/dist/node-esm/internal.js +2 -2
  35. package/dist/node-esm/src/platform_browser/providers/phone.d.ts +1 -1
  36. package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_loader.d.ts +5 -0
  37. package/dist/rn/index.js +1 -1
  38. package/dist/rn/internal.js +1 -1
  39. package/dist/rn/{phone-d791a05d.js → phone-3e5c3820.js} +50 -37
  40. package/dist/rn/phone-3e5c3820.js.map +1 -0
  41. package/dist/rn/src/platform_browser/providers/phone.d.ts +1 -1
  42. package/dist/rn/src/platform_browser/recaptcha/recaptcha_loader.d.ts +5 -0
  43. package/dist/src/platform_browser/providers/phone.d.ts +1 -1
  44. package/dist/src/platform_browser/recaptcha/recaptcha_loader.d.ts +5 -0
  45. package/package.json +6 -6
  46. package/dist/cordova/popup_redirect-9ed330a1.js.map +0 -1
  47. package/dist/esm2017/index-69ab4e3a.js.map +0 -1
  48. package/dist/esm5/index-81005f8a.js.map +0 -1
  49. package/dist/node/index-007f80f6.js.map +0 -1
  50. package/dist/node-esm/index-b1f59f63.js.map +0 -1
  51. package/dist/rn/phone-d791a05d.js.map +0 -1
@@ -1,4 +1,4 @@
1
- export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-69ab4e3a.js';
1
+ export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-25da8a76.js';
2
2
  import '@firebase/util';
3
3
  import '@firebase/app';
4
4
  import 'tslib';
@@ -1,5 +1,5 @@
1
- import { ap as _isIOS7Or8, aq as debugAssert, ar as _isIOS, as as _isAndroid, at as _fail, au as _getRedirectUrl, av as _getProjectConfig, aw as _createError, ax as _assert, ay as _getInstance, b as browserLocalPersistence, az as _persistenceKeyName, aA as AuthEventManager, a as browserSessionPersistence, aB as _getRedirectResult, aC as _overrideRedirectResult, aD as _clearRedirectOutcomes, aE as _castAuth } from './index-69ab4e3a.js';
2
- export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, aG as AuthImpl, aJ as AuthPopup, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, aK as FetchProvider, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aL as SAMLAuthCredential, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, aF as UserImpl, ax as _assert, aE as _castAuth, at as _fail, aI as _generateEventId, aH as _getClientVersion, ay as _getInstance, aB as _getRedirectResult, aC as _overrideRedirectResult, az as _persistenceKeyName, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-69ab4e3a.js';
1
+ import { ap as _isIOS7Or8, aq as debugAssert, ar as _isIOS, as as _isAndroid, at as _fail, au as _getRedirectUrl, av as _getProjectConfig, aw as _createError, ax as _assert, ay as _getInstance, b as browserLocalPersistence, az as _persistenceKeyName, aA as AuthEventManager, a as browserSessionPersistence, aB as _getRedirectResult, aC as _overrideRedirectResult, aD as _clearRedirectOutcomes, aE as _castAuth } from './index-25da8a76.js';
2
+ export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, aG as AuthImpl, aJ as AuthPopup, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, aK as FetchProvider, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aL as SAMLAuthCredential, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, aF as UserImpl, ax as _assert, aE as _castAuth, at as _fail, aI as _generateEventId, aH as _getClientVersion, ay as _getInstance, aB as _getRedirectResult, aC as _overrideRedirectResult, az as _persistenceKeyName, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-25da8a76.js';
3
3
  import { querystringDecode } from '@firebase/util';
4
4
  import '@firebase/app';
5
5
  import 'tslib';
@@ -133,7 +133,7 @@ export declare class PhoneAuthProvider {
133
133
  * auth.currentUser,
134
134
  * PhoneAuthProvider.credential(verificationId, code));
135
135
  * } catch (e) {
136
- * if (e.code === 'auth/account-exists-with-different-credential') {
136
+ * if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {
137
137
  * const cred = PhoneAuthProvider.credentialFromError(e);
138
138
  * await linkWithCredential(auth.currentUser, cred);
139
139
  * }
@@ -33,6 +33,11 @@ export interface ReCaptchaLoader {
33
33
  export declare class ReCaptchaLoaderImpl implements ReCaptchaLoader {
34
34
  private hostLanguage;
35
35
  private counter;
36
+ /**
37
+ * Check for `render()` method. `window.grecaptcha` will exist if the Enterprise
38
+ * version of the ReCAPTCHA script was loaded by someone else (e.g. App Check) but
39
+ * `window.grecaptcha.render()` will not. Another load will add it.
40
+ */
36
41
  private readonly librarySeparatelyLoaded;
37
42
  load(auth: AuthInternal, hl?: string): Promise<Recaptcha>;
38
43
  clearedOneInstance(): void;
@@ -1253,7 +1253,8 @@ function secondsStringToMilliseconds(seconds) {
1253
1253
  return Number(seconds) * 1000;
1254
1254
  }
1255
1255
  function _parseToken(token) {
1256
- var _a = token.split('.'), algorithm = _a[0], payload = _a[1], signature = _a[2];
1256
+ var _a;
1257
+ var _b = token.split('.'), algorithm = _b[0], payload = _b[1], signature = _b[2];
1257
1258
  if (algorithm === undefined ||
1258
1259
  payload === undefined ||
1259
1260
  signature === undefined) {
@@ -1269,7 +1270,7 @@ function _parseToken(token) {
1269
1270
  return JSON.parse(decoded);
1270
1271
  }
1271
1272
  catch (e) {
1272
- _logError('Caught error parsing JWT payload as JSON', e);
1273
+ _logError('Caught error parsing JWT payload as JSON', (_a = e) === null || _a === void 0 ? void 0 : _a.toString());
1273
1274
  return null;
1274
1275
  }
1275
1276
  }
@@ -1413,20 +1414,21 @@ var ProactiveRefresh = /** @class */ (function () {
1413
1414
  }); }, interval);
1414
1415
  };
1415
1416
  ProactiveRefresh.prototype.iteration = function () {
1417
+ var _a;
1416
1418
  return __awaiter(this, void 0, void 0, function () {
1417
1419
  var e_1;
1418
- return __generator(this, function (_a) {
1419
- switch (_a.label) {
1420
+ return __generator(this, function (_b) {
1421
+ switch (_b.label) {
1420
1422
  case 0:
1421
- _a.trys.push([0, 2, , 3]);
1423
+ _b.trys.push([0, 2, , 3]);
1422
1424
  return [4 /*yield*/, this.user.getIdToken(true)];
1423
1425
  case 1:
1424
- _a.sent();
1426
+ _b.sent();
1425
1427
  return [3 /*break*/, 3];
1426
1428
  case 2:
1427
- e_1 = _a.sent();
1429
+ e_1 = _b.sent();
1428
1430
  // Only retry on network errors
1429
- if (e_1.code === "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
1431
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
1430
1432
  this.schedule(/* wasError */ true);
1431
1433
  }
1432
1434
  return [2 /*return*/];
@@ -2389,7 +2391,8 @@ function _isWebOS(ua) {
2389
2391
  }
2390
2392
  function _isIOS(ua) {
2391
2393
  if (ua === void 0) { ua = getUA(); }
2392
- return /iphone|ipad|ipod/i.test(ua);
2394
+ return /iphone|ipad|ipod/i.test(ua) ||
2395
+ (/macintosh/i.test(ua) && /mobile/i.test(ua));
2393
2396
  }
2394
2397
  function _isIOS7Or8(ua) {
2395
2398
  if (ua === void 0) { ua = getUA(); }
@@ -2812,19 +2815,20 @@ var AuthImpl = /** @class */ (function () {
2812
2815
  });
2813
2816
  };
2814
2817
  AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
2818
+ var _a;
2815
2819
  return __awaiter(this, void 0, void 0, function () {
2816
2820
  var e_4;
2817
- return __generator(this, function (_a) {
2818
- switch (_a.label) {
2821
+ return __generator(this, function (_b) {
2822
+ switch (_b.label) {
2819
2823
  case 0:
2820
- _a.trys.push([0, 2, , 3]);
2824
+ _b.trys.push([0, 2, , 3]);
2821
2825
  return [4 /*yield*/, _reloadWithoutSaving(user)];
2822
2826
  case 1:
2823
- _a.sent();
2827
+ _b.sent();
2824
2828
  return [3 /*break*/, 3];
2825
2829
  case 2:
2826
- e_4 = _a.sent();
2827
- if (e_4.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2830
+ e_4 = _b.sent();
2831
+ if (((_a = e_4) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2828
2832
  // Something's wrong with the user's token. Log them out and remove
2829
2833
  // them from storage
2830
2834
  return [2 /*return*/, this.directlySetCurrentUser(null)];
@@ -5441,20 +5445,21 @@ function _assertLinkedStatus(expected, user, provider) {
5441
5445
  * limitations under the License.
5442
5446
  */
5443
5447
  function _reauthenticate(user, credential, bypassAuthState) {
5448
+ var _a;
5444
5449
  if (bypassAuthState === void 0) { bypassAuthState = false; }
5445
5450
  return __awaiter(this, void 0, void 0, function () {
5446
5451
  var auth, operationType, response, parsed, localId, e_1;
5447
- return __generator(this, function (_a) {
5448
- switch (_a.label) {
5452
+ return __generator(this, function (_b) {
5453
+ switch (_b.label) {
5449
5454
  case 0:
5450
5455
  auth = user.auth;
5451
5456
  operationType = "reauthenticate" /* REAUTHENTICATE */;
5452
- _a.label = 1;
5457
+ _b.label = 1;
5453
5458
  case 1:
5454
- _a.trys.push([1, 3, , 4]);
5459
+ _b.trys.push([1, 3, , 4]);
5455
5460
  return [4 /*yield*/, _logoutIfInvalidated(user, _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user), bypassAuthState)];
5456
5461
  case 2:
5457
- response = _a.sent();
5462
+ response = _b.sent();
5458
5463
  _assert(response.idToken, auth, "internal-error" /* INTERNAL_ERROR */);
5459
5464
  parsed = _parseToken(response.idToken);
5460
5465
  _assert(parsed, auth, "internal-error" /* INTERNAL_ERROR */);
@@ -5462,9 +5467,9 @@ function _reauthenticate(user, credential, bypassAuthState) {
5462
5467
  _assert(user.uid === localId, auth, "user-mismatch" /* USER_MISMATCH */);
5463
5468
  return [2 /*return*/, UserCredentialImpl._forOperation(user, operationType, response)];
5464
5469
  case 3:
5465
- e_1 = _a.sent();
5470
+ e_1 = _b.sent();
5466
5471
  // Convert user deleted error into user mismatch
5467
- if ((e_1 === null || e_1 === void 0 ? void 0 : e_1.code) === "auth/" + "user-not-found" /* USER_DELETED */) {
5472
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "user-not-found" /* USER_DELETED */) {
5468
5473
  _fail(auth, "user-mismatch" /* USER_MISMATCH */);
5469
5474
  }
5470
5475
  throw e_1;
@@ -6990,21 +6995,22 @@ var MultiFactorUserImpl = /** @class */ (function () {
6990
6995
  });
6991
6996
  };
6992
6997
  MultiFactorUserImpl.prototype.unenroll = function (infoOrUid) {
6998
+ var _a;
6993
6999
  return __awaiter(this, void 0, void 0, function () {
6994
7000
  var mfaEnrollmentId, idToken, idTokenResponse, e_1;
6995
- return __generator(this, function (_a) {
6996
- switch (_a.label) {
7001
+ return __generator(this, function (_b) {
7002
+ switch (_b.label) {
6997
7003
  case 0:
6998
7004
  mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;
6999
7005
  return [4 /*yield*/, this.user.getIdToken()];
7000
7006
  case 1:
7001
- idToken = _a.sent();
7007
+ idToken = _b.sent();
7002
7008
  return [4 /*yield*/, _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {
7003
7009
  idToken: idToken,
7004
7010
  mfaEnrollmentId: mfaEnrollmentId
7005
7011
  }))];
7006
7012
  case 2:
7007
- idTokenResponse = _a.sent();
7013
+ idTokenResponse = _b.sent();
7008
7014
  // Remove the second factor from the user's list.
7009
7015
  this.enrolledFactors = this.enrolledFactors.filter(function (_a) {
7010
7016
  var uid = _a.uid;
@@ -7020,17 +7026,17 @@ var MultiFactorUserImpl = /** @class */ (function () {
7020
7026
  // the tokenResponse may be empty. If the tokens were not updated (and they
7021
7027
  // are now invalid), reloading the user will discover this and invalidate
7022
7028
  // the user's state accordingly.
7023
- _a.sent();
7024
- _a.label = 4;
7029
+ _b.sent();
7030
+ _b.label = 4;
7025
7031
  case 4:
7026
- _a.trys.push([4, 6, , 7]);
7032
+ _b.trys.push([4, 6, , 7]);
7027
7033
  return [4 /*yield*/, this.user.reload()];
7028
7034
  case 5:
7029
- _a.sent();
7035
+ _b.sent();
7030
7036
  return [3 /*break*/, 7];
7031
7037
  case 6:
7032
- e_1 = _a.sent();
7033
- if (e_1.code !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
7038
+ e_1 = _b.sent();
7039
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
7034
7040
  throw e_1;
7035
7041
  }
7036
7042
  return [3 /*break*/, 7];
@@ -8570,9 +8576,15 @@ var RECAPTCHA_BASE = 'https://www.google.com/recaptcha/api.js?';
8570
8576
  */
8571
8577
  var ReCaptchaLoaderImpl = /** @class */ (function () {
8572
8578
  function ReCaptchaLoaderImpl() {
8579
+ var _a;
8573
8580
  this.hostLanguage = '';
8574
8581
  this.counter = 0;
8575
- this.librarySeparatelyLoaded = !!_window().grecaptcha;
8582
+ /**
8583
+ * Check for `render()` method. `window.grecaptcha` will exist if the Enterprise
8584
+ * version of the ReCAPTCHA script was loaded by someone else (e.g. App Check) but
8585
+ * `window.grecaptcha.render()` will not. Another load will add it.
8586
+ */
8587
+ this.librarySeparatelyLoaded = !!((_a = _window().grecaptcha) === null || _a === void 0 ? void 0 : _a.render);
8576
8588
  }
8577
8589
  ReCaptchaLoaderImpl.prototype.load = function (auth, hl) {
8578
8590
  var _this = this;
@@ -8619,6 +8631,7 @@ var ReCaptchaLoaderImpl = /** @class */ (function () {
8619
8631
  this.counter--;
8620
8632
  };
8621
8633
  ReCaptchaLoaderImpl.prototype.shouldResolveImmediately = function (hl) {
8634
+ var _a;
8622
8635
  // We can resolve immediately if:
8623
8636
  // • grecaptcha is already defined AND (
8624
8637
  // 1. the requested language codes are the same OR
@@ -8626,7 +8639,7 @@ var ReCaptchaLoaderImpl = /** @class */ (function () {
8626
8639
  // 3. the library was already loaded by the app
8627
8640
  // In cases (2) and (3), we _can't_ reload as it would break the recaptchas
8628
8641
  // that are already in the page
8629
- return (!!_window().grecaptcha &&
8642
+ return (!!((_a = _window().grecaptcha) === null || _a === void 0 ? void 0 : _a.render) &&
8630
8643
  (hl === this.hostLanguage ||
8631
8644
  this.counter > 0 ||
8632
8645
  this.librarySeparatelyLoaded));
@@ -9281,7 +9294,7 @@ var PhoneAuthProvider = /** @class */ (function () {
9281
9294
  * auth.currentUser,
9282
9295
  * PhoneAuthProvider.credential(verificationId, code));
9283
9296
  * } catch (e) {
9284
- * if (e.code === 'auth/account-exists-with-different-credential') {
9297
+ * if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {
9285
9298
  * const cred = PhoneAuthProvider.credentialFromError(e);
9286
9299
  * await linkWithCredential(auth.currentUser, cred);
9287
9300
  * }
@@ -11053,7 +11066,7 @@ var PhoneMultiFactorGenerator = /** @class */ (function () {
11053
11066
  }());
11054
11067
 
11055
11068
  var name = "@firebase/auth";
11056
- var version = "0.20.3";
11069
+ var version = "0.20.4-canary.13550089f";
11057
11070
 
11058
11071
  /**
11059
11072
  * @license
@@ -11259,4 +11272,4 @@ function getAuth(app) {
11259
11272
  registerAuth("Browser" /* BROWSER */);
11260
11273
 
11261
11274
  export { signInWithCustomToken as $, ActionCodeOperation as A, debugErrorMap as B, prodErrorMap as C, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as D, initializeAuth as E, FactorId as F, connectAuthEmulator as G, AuthCredential as H, EmailAuthCredential as I, OAuthCredential as J, PhoneAuthCredential as K, inMemoryPersistence as L, EmailAuthProvider as M, FacebookAuthProvider as N, OperationType as O, PhoneAuthProvider as P, GoogleAuthProvider as Q, RecaptchaVerifier as R, SignInMethod as S, GithubAuthProvider as T, OAuthProvider as U, SAMLAuthProvider as V, TwitterAuthProvider as W, signInAnonymously as X, signInWithCredential as Y, linkWithCredential as Z, reauthenticateWithCredential as _, browserSessionPersistence as a, sendPasswordResetEmail as a0, confirmPasswordReset as a1, applyActionCode as a2, checkActionCode as a3, verifyPasswordResetCode as a4, createUserWithEmailAndPassword as a5, signInWithEmailAndPassword as a6, sendSignInLinkToEmail as a7, isSignInWithEmailLink as a8, signInWithEmailLink as a9, _persistenceKeyName as aA, _clearRedirectOutcomes as aB, _getRedirectResult as aC, _overrideRedirectResult as aD, _castAuth as aE, UserImpl as aF, AuthImpl as aG, _getClientVersion as aH, _generateEventId as aI, AuthPopup as aJ, FetchProvider as aK, SAMLAuthCredential as aL, fetchSignInMethodsForEmail as aa, sendEmailVerification as ab, verifyBeforeUpdateEmail as ac, ActionCodeURL as ad, parseActionCodeURL as ae, updateProfile as af, updateEmail as ag, updatePassword as ah, getIdToken as ai, getIdTokenResult as aj, unlink as ak, getAdditionalUserInfo as al, reload as am, getMultiFactorResolver as an, multiFactor as ao, _isAndroid as ap, _isIOS7Or8 as aq, _isIOS as ar, _fail as as, _getRedirectUrl as at, debugAssert as au, _getProjectConfig as av, _createError as aw, _assert as ax, AuthEventManager as ay, _getInstance as az, browserLocalPersistence as b, signInWithPopup as c, linkWithPopup as d, reauthenticateWithPopup as e, signInWithRedirect as f, linkWithRedirect as g, reauthenticateWithRedirect as h, indexedDBLocalPersistence as i, getRedirectResult as j, browserPopupRedirectResolver as k, linkWithPhoneNumber as l, PhoneMultiFactorGenerator as m, getAuth as n, ProviderId as o, setPersistence as p, onIdTokenChanged as q, reauthenticateWithPhoneNumber as r, signInWithPhoneNumber as s, beforeAuthStateChanged as t, updatePhoneNumber as u, onAuthStateChanged as v, useDeviceLanguage as w, updateCurrentUser as x, signOut as y, deleteUser as z };
11262
- //# sourceMappingURL=index-81005f8a.js.map
11275
+ //# sourceMappingURL=index-66b1cbdf.js.map