@firebase/auth 0.20.2 → 0.20.3-canary.8e952e2ee

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 (44) hide show
  1. package/CHANGELOG.md +13 -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 +3 -3
  6. package/dist/cordova/internal.js.map +1 -1
  7. package/dist/cordova/{popup_redirect-e449cb08.js → popup_redirect-4884fc1f.js} +54 -48
  8. package/dist/cordova/popup_redirect-4884fc1f.js.map +1 -0
  9. package/dist/cordova/src/platform_browser/providers/phone.d.ts +1 -1
  10. package/dist/esm2017/{index-ccf9d100.js → index-73de905c.js} +15 -9
  11. package/dist/esm2017/index-73de905c.js.map +1 -0
  12. package/dist/esm2017/index.js +1 -1
  13. package/dist/esm2017/internal.js +2 -2
  14. package/dist/esm2017/src/platform_browser/providers/phone.d.ts +1 -1
  15. package/dist/esm5/{index-ea3c621a.js → index-34ff6623.js} +55 -49
  16. package/dist/esm5/index-34ff6623.js.map +1 -0
  17. package/dist/esm5/index.js +1 -1
  18. package/dist/esm5/internal.js +2 -2
  19. package/dist/esm5/src/platform_browser/providers/phone.d.ts +1 -1
  20. package/dist/index.webworker.esm5.js +53 -47
  21. package/dist/index.webworker.esm5.js.map +1 -1
  22. package/dist/node/{index-cc504aa1.js → index-845bb23f.js} +54 -48
  23. package/dist/node/index-845bb23f.js.map +1 -0
  24. package/dist/node/index.js +1 -1
  25. package/dist/node/internal.js +1 -1
  26. package/dist/node/src/platform_browser/providers/phone.d.ts +1 -1
  27. package/dist/node-esm/{index-14ee511d.js → index-20c7e2dd.js} +14 -8
  28. package/dist/node-esm/index-20c7e2dd.js.map +1 -0
  29. package/dist/node-esm/index.js +1 -1
  30. package/dist/node-esm/internal.js +2 -2
  31. package/dist/node-esm/src/platform_browser/providers/phone.d.ts +1 -1
  32. package/dist/rn/index.js +1 -1
  33. package/dist/rn/internal.js +1 -1
  34. package/dist/rn/{phone-dd9c6425.js → phone-cb586eb5.js} +55 -49
  35. package/dist/rn/phone-cb586eb5.js.map +1 -0
  36. package/dist/rn/src/platform_browser/providers/phone.d.ts +1 -1
  37. package/dist/src/platform_browser/providers/phone.d.ts +1 -1
  38. package/package.json +39 -14
  39. package/dist/cordova/popup_redirect-e449cb08.js.map +0 -1
  40. package/dist/esm2017/index-ccf9d100.js.map +0 -1
  41. package/dist/esm5/index-ea3c621a.js.map +0 -1
  42. package/dist/node/index-cc504aa1.js.map +0 -1
  43. package/dist/node-esm/index-14ee511d.js.map +0 -1
  44. package/dist/rn/phone-dd9c6425.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-14ee511d.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-20c7e2dd.js';
2
2
  import '@firebase/util';
3
3
  import '@firebase/app';
4
4
  import 'tslib';
@@ -1,5 +1,5 @@
1
- import { ap as _getInstance, aq as _assert, ar as _signInWithCredential, as as _reauthenticate, at as _link$1, H as AuthCredential, au as signInWithIdp, av as _fail, aw as debugAssert, ax as _persistenceKeyName, ay as _castAuth, az as FederatedAuthProvider, aA as BaseOAuthProvider, aB as _emulatorUrl, aC as _performApiRequest, aD as _isIOS7Or8, aE as _isIOS, aF as _isAndroid, aG as _createError, aH as _isSafari, aI as _isIframe, aJ as _isMobileBrowser, aK as _isIE10 } from './index-14ee511d.js';
2
- export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, aM as AuthImpl, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, aO 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, aP as SAMLAuthCredential, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, aL as UserImpl, aq as _assert, ay as _castAuth, av as _fail, aN as _getClientVersion, ap as _getInstance, ax 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-14ee511d.js';
1
+ import { ap as _getInstance, aq as _assert, ar as _signInWithCredential, as as _reauthenticate, at as _link$1, H as AuthCredential, au as signInWithIdp, av as _fail, aw as debugAssert, ax as _persistenceKeyName, ay as _castAuth, az as FederatedAuthProvider, aA as BaseOAuthProvider, aB as _emulatorUrl, aC as _performApiRequest, aD as _isIOS7Or8, aE as _isIOS, aF as _isAndroid, aG as _createError, aH as _isSafari, aI as _isIframe, aJ as _isMobileBrowser, aK as _isIE10 } from './index-20c7e2dd.js';
2
+ export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, aM as AuthImpl, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, aO 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, aP as SAMLAuthCredential, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, aL as UserImpl, aq as _assert, ay as _castAuth, av as _fail, aN as _getClientVersion, ap as _getInstance, ax 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-20c7e2dd.js';
3
3
  import { querystring, isEmpty, getUA, querystringDecode } from '@firebase/util';
4
4
  import 'tslib';
5
5
  import { SDK_VERSION } from '@firebase/app';
@@ -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
  * }
package/dist/rn/index.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var ReactNative = require('react-native');
6
6
  var app = require('@firebase/app');
7
- var phone = require('./phone-dd9c6425.js');
7
+ var phone = require('./phone-cb586eb5.js');
8
8
  var tslib = require('tslib');
9
9
  require('@firebase/util');
10
10
  require('@firebase/component');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var phone = require('./phone-dd9c6425.js');
5
+ var phone = require('./phone-cb586eb5.js');
6
6
  var tslib = require('tslib');
7
7
  var util = require('@firebase/util');
8
8
  var app = require('@firebase/app');
@@ -1157,7 +1157,8 @@ function secondsStringToMilliseconds(seconds) {
1157
1157
  return Number(seconds) * 1000;
1158
1158
  }
1159
1159
  function _parseToken(token) {
1160
- var _a = token.split('.'), algorithm = _a[0], payload = _a[1], signature = _a[2];
1160
+ var _a;
1161
+ var _b = token.split('.'), algorithm = _b[0], payload = _b[1], signature = _b[2];
1161
1162
  if (algorithm === undefined ||
1162
1163
  payload === undefined ||
1163
1164
  signature === undefined) {
@@ -1173,7 +1174,7 @@ function _parseToken(token) {
1173
1174
  return JSON.parse(decoded);
1174
1175
  }
1175
1176
  catch (e) {
1176
- _logError('Caught error parsing JWT payload as JSON', e);
1177
+ _logError('Caught error parsing JWT payload as JSON', (_a = e) === null || _a === void 0 ? void 0 : _a.toString());
1177
1178
  return null;
1178
1179
  }
1179
1180
  }
@@ -1317,20 +1318,21 @@ var ProactiveRefresh = /** @class */ (function () {
1317
1318
  }); }, interval);
1318
1319
  };
1319
1320
  ProactiveRefresh.prototype.iteration = function () {
1321
+ var _a;
1320
1322
  return tslib.__awaiter(this, void 0, void 0, function () {
1321
1323
  var e_1;
1322
- return tslib.__generator(this, function (_a) {
1323
- switch (_a.label) {
1324
+ return tslib.__generator(this, function (_b) {
1325
+ switch (_b.label) {
1324
1326
  case 0:
1325
- _a.trys.push([0, 2, , 3]);
1327
+ _b.trys.push([0, 2, , 3]);
1326
1328
  return [4 /*yield*/, this.user.getIdToken(true)];
1327
1329
  case 1:
1328
- _a.sent();
1330
+ _b.sent();
1329
1331
  return [3 /*break*/, 3];
1330
1332
  case 2:
1331
- e_1 = _a.sent();
1333
+ e_1 = _b.sent();
1332
1334
  // Only retry on network errors
1333
- if (e_1.code === "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
1335
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
1334
1336
  this.schedule(/* wasError */ true);
1335
1337
  }
1336
1338
  return [2 /*return*/];
@@ -2419,48 +2421,49 @@ var AuthMiddlewareQueue = /** @class */ (function () {
2419
2421
  };
2420
2422
  };
2421
2423
  AuthMiddlewareQueue.prototype.runMiddleware = function (nextUser) {
2424
+ var _a;
2422
2425
  return tslib.__awaiter(this, void 0, void 0, function () {
2423
- var onAbortStack, _i, _a, beforeStateCallback, e_1, _b, onAbortStack_1, onAbort;
2424
- return tslib.__generator(this, function (_c) {
2425
- switch (_c.label) {
2426
+ var onAbortStack, _i, _b, beforeStateCallback, e_1, _c, onAbortStack_1, onAbort;
2427
+ return tslib.__generator(this, function (_d) {
2428
+ switch (_d.label) {
2426
2429
  case 0:
2427
2430
  if (this.auth.currentUser === nextUser) {
2428
2431
  return [2 /*return*/];
2429
2432
  }
2430
2433
  onAbortStack = [];
2431
- _c.label = 1;
2434
+ _d.label = 1;
2432
2435
  case 1:
2433
- _c.trys.push([1, 6, , 7]);
2434
- _i = 0, _a = this.queue;
2435
- _c.label = 2;
2436
+ _d.trys.push([1, 6, , 7]);
2437
+ _i = 0, _b = this.queue;
2438
+ _d.label = 2;
2436
2439
  case 2:
2437
- if (!(_i < _a.length)) return [3 /*break*/, 5];
2438
- beforeStateCallback = _a[_i];
2440
+ if (!(_i < _b.length)) return [3 /*break*/, 5];
2441
+ beforeStateCallback = _b[_i];
2439
2442
  return [4 /*yield*/, beforeStateCallback(nextUser)];
2440
2443
  case 3:
2441
- _c.sent();
2444
+ _d.sent();
2442
2445
  // Only push the onAbort if the callback succeeds
2443
2446
  if (beforeStateCallback.onAbort) {
2444
2447
  onAbortStack.push(beforeStateCallback.onAbort);
2445
2448
  }
2446
- _c.label = 4;
2449
+ _d.label = 4;
2447
2450
  case 4:
2448
2451
  _i++;
2449
2452
  return [3 /*break*/, 2];
2450
2453
  case 5: return [3 /*break*/, 7];
2451
2454
  case 6:
2452
- e_1 = _c.sent();
2455
+ e_1 = _d.sent();
2453
2456
  // Run all onAbort, with separate try/catch to ignore any errors and
2454
2457
  // continue
2455
2458
  onAbortStack.reverse();
2456
- for (_b = 0, onAbortStack_1 = onAbortStack; _b < onAbortStack_1.length; _b++) {
2457
- onAbort = onAbortStack_1[_b];
2459
+ for (_c = 0, onAbortStack_1 = onAbortStack; _c < onAbortStack_1.length; _c++) {
2460
+ onAbort = onAbortStack_1[_c];
2458
2461
  try {
2459
2462
  onAbort();
2460
2463
  }
2461
2464
  catch (_) { /* swallow error */ }
2462
2465
  }
2463
- throw this.auth._errorFactory.create("login-blocked" /* LOGIN_BLOCKED */, { originalMessage: e_1.message });
2466
+ throw this.auth._errorFactory.create("login-blocked" /* LOGIN_BLOCKED */, { originalMessage: (_a = e_1) === null || _a === void 0 ? void 0 : _a.message });
2464
2467
  case 7: return [2 /*return*/];
2465
2468
  }
2466
2469
  });
@@ -2715,19 +2718,20 @@ var AuthImpl = /** @class */ (function () {
2715
2718
  });
2716
2719
  };
2717
2720
  AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
2721
+ var _a;
2718
2722
  return tslib.__awaiter(this, void 0, void 0, function () {
2719
2723
  var e_4;
2720
- return tslib.__generator(this, function (_a) {
2721
- switch (_a.label) {
2724
+ return tslib.__generator(this, function (_b) {
2725
+ switch (_b.label) {
2722
2726
  case 0:
2723
- _a.trys.push([0, 2, , 3]);
2727
+ _b.trys.push([0, 2, , 3]);
2724
2728
  return [4 /*yield*/, _reloadWithoutSaving(user)];
2725
2729
  case 1:
2726
- _a.sent();
2730
+ _b.sent();
2727
2731
  return [3 /*break*/, 3];
2728
2732
  case 2:
2729
- e_4 = _a.sent();
2730
- if (e_4.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2733
+ e_4 = _b.sent();
2734
+ if (((_a = e_4) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2731
2735
  // Something's wrong with the user's token. Log them out and remove
2732
2736
  // them from storage
2733
2737
  return [2 /*return*/, this.directlySetCurrentUser(null)];
@@ -5344,20 +5348,21 @@ function _assertLinkedStatus(expected, user, provider) {
5344
5348
  * limitations under the License.
5345
5349
  */
5346
5350
  function _reauthenticate(user, credential, bypassAuthState) {
5351
+ var _a;
5347
5352
  if (bypassAuthState === void 0) { bypassAuthState = false; }
5348
5353
  return tslib.__awaiter(this, void 0, void 0, function () {
5349
5354
  var auth, operationType, response, parsed, localId, e_1;
5350
- return tslib.__generator(this, function (_a) {
5351
- switch (_a.label) {
5355
+ return tslib.__generator(this, function (_b) {
5356
+ switch (_b.label) {
5352
5357
  case 0:
5353
5358
  auth = user.auth;
5354
5359
  operationType = "reauthenticate" /* REAUTHENTICATE */;
5355
- _a.label = 1;
5360
+ _b.label = 1;
5356
5361
  case 1:
5357
- _a.trys.push([1, 3, , 4]);
5362
+ _b.trys.push([1, 3, , 4]);
5358
5363
  return [4 /*yield*/, _logoutIfInvalidated(user, _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user), bypassAuthState)];
5359
5364
  case 2:
5360
- response = _a.sent();
5365
+ response = _b.sent();
5361
5366
  _assert(response.idToken, auth, "internal-error" /* INTERNAL_ERROR */);
5362
5367
  parsed = _parseToken(response.idToken);
5363
5368
  _assert(parsed, auth, "internal-error" /* INTERNAL_ERROR */);
@@ -5365,9 +5370,9 @@ function _reauthenticate(user, credential, bypassAuthState) {
5365
5370
  _assert(user.uid === localId, auth, "user-mismatch" /* USER_MISMATCH */);
5366
5371
  return [2 /*return*/, UserCredentialImpl._forOperation(user, operationType, response)];
5367
5372
  case 3:
5368
- e_1 = _a.sent();
5373
+ e_1 = _b.sent();
5369
5374
  // Convert user deleted error into user mismatch
5370
- if ((e_1 === null || e_1 === void 0 ? void 0 : e_1.code) === "auth/" + "user-not-found" /* USER_DELETED */) {
5375
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "user-not-found" /* USER_DELETED */) {
5371
5376
  _fail(auth, "user-mismatch" /* USER_MISMATCH */);
5372
5377
  }
5373
5378
  throw e_1;
@@ -6893,21 +6898,22 @@ var MultiFactorUserImpl = /** @class */ (function () {
6893
6898
  });
6894
6899
  };
6895
6900
  MultiFactorUserImpl.prototype.unenroll = function (infoOrUid) {
6901
+ var _a;
6896
6902
  return tslib.__awaiter(this, void 0, void 0, function () {
6897
6903
  var mfaEnrollmentId, idToken, idTokenResponse, e_1;
6898
- return tslib.__generator(this, function (_a) {
6899
- switch (_a.label) {
6904
+ return tslib.__generator(this, function (_b) {
6905
+ switch (_b.label) {
6900
6906
  case 0:
6901
6907
  mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;
6902
6908
  return [4 /*yield*/, this.user.getIdToken()];
6903
6909
  case 1:
6904
- idToken = _a.sent();
6910
+ idToken = _b.sent();
6905
6911
  return [4 /*yield*/, _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {
6906
6912
  idToken: idToken,
6907
6913
  mfaEnrollmentId: mfaEnrollmentId
6908
6914
  }))];
6909
6915
  case 2:
6910
- idTokenResponse = _a.sent();
6916
+ idTokenResponse = _b.sent();
6911
6917
  // Remove the second factor from the user's list.
6912
6918
  this.enrolledFactors = this.enrolledFactors.filter(function (_a) {
6913
6919
  var uid = _a.uid;
@@ -6923,17 +6929,17 @@ var MultiFactorUserImpl = /** @class */ (function () {
6923
6929
  // the tokenResponse may be empty. If the tokens were not updated (and they
6924
6930
  // are now invalid), reloading the user will discover this and invalidate
6925
6931
  // the user's state accordingly.
6926
- _a.sent();
6927
- _a.label = 4;
6932
+ _b.sent();
6933
+ _b.label = 4;
6928
6934
  case 4:
6929
- _a.trys.push([4, 6, , 7]);
6935
+ _b.trys.push([4, 6, , 7]);
6930
6936
  return [4 /*yield*/, this.user.reload()];
6931
6937
  case 5:
6932
- _a.sent();
6938
+ _b.sent();
6933
6939
  return [3 /*break*/, 7];
6934
6940
  case 6:
6935
- e_1 = _a.sent();
6936
- if (e_1.code !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
6941
+ e_1 = _b.sent();
6942
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
6937
6943
  throw e_1;
6938
6944
  }
6939
6945
  return [3 /*break*/, 7];
@@ -6964,7 +6970,7 @@ function multiFactor(user) {
6964
6970
  }
6965
6971
 
6966
6972
  var name = "@firebase/auth";
6967
- var version = "0.20.2";
6973
+ var version = "0.20.3-canary.8e952e2ee";
6968
6974
 
6969
6975
  /**
6970
6976
  * @license
@@ -8271,7 +8277,7 @@ var PhoneAuthProvider = /** @class */ (function () {
8271
8277
  * auth.currentUser,
8272
8278
  * PhoneAuthProvider.credential(verificationId, code));
8273
8279
  * } catch (e) {
8274
- * if (e.code === 'auth/account-exists-with-different-credential') {
8280
+ * if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {
8275
8281
  * const cred = PhoneAuthProvider.credentialFromError(e);
8276
8282
  * await linkWithCredential(auth.currentUser, cred);
8277
8283
  * }
@@ -8489,4 +8495,4 @@ exports.updateProfile = updateProfile;
8489
8495
  exports.useDeviceLanguage = useDeviceLanguage;
8490
8496
  exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
8491
8497
  exports.verifyPasswordResetCode = verifyPasswordResetCode;
8492
- //# sourceMappingURL=phone-dd9c6425.js.map
8498
+ //# sourceMappingURL=phone-cb586eb5.js.map