@firebase/auth 0.20.3 → 0.20.4-canary.b60cf76e1

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 +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 +3 -3
  6. package/dist/cordova/internal.js.map +1 -1
  7. package/dist/cordova/{popup_redirect-9ed330a1.js → popup_redirect-ce1dc327.js} +40 -34
  8. package/dist/cordova/popup_redirect-ce1dc327.js.map +1 -0
  9. package/dist/cordova/src/platform_browser/providers/phone.d.ts +1 -1
  10. package/dist/esm2017/{index-69ab4e3a.js → index-a3c777d2.js} +15 -9
  11. package/dist/esm2017/index-a3c777d2.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-81005f8a.js → index-f0d874a2.js} +41 -35
  16. package/dist/esm5/index-f0d874a2.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 +37 -32
  21. package/dist/index.webworker.esm5.js.map +1 -1
  22. package/dist/node/{index-007f80f6.js → index-28536591.js} +40 -34
  23. package/dist/node/index-28536591.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-b1f59f63.js → index-44a8b753.js} +14 -8
  28. package/dist/node-esm/index-44a8b753.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-d791a05d.js → phone-05acddef.js} +41 -35
  35. package/dist/rn/phone-05acddef.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 +6 -6
  39. package/dist/cordova/popup_redirect-9ed330a1.js.map +0 -1
  40. package/dist/esm2017/index-69ab4e3a.js.map +0 -1
  41. package/dist/esm5/index-81005f8a.js.map +0 -1
  42. package/dist/node/index-007f80f6.js.map +0 -1
  43. package/dist/node-esm/index-b1f59f63.js.map +0 -1
  44. package/dist/rn/phone-d791a05d.js.map +0 -1
@@ -2069,7 +2069,8 @@ function secondsStringToMilliseconds(seconds) {
2069
2069
  return Number(seconds) * 1000;
2070
2070
  }
2071
2071
  function _parseToken(token) {
2072
- var _a = token.split('.'), algorithm = _a[0], payload = _a[1], signature = _a[2];
2072
+ var _a;
2073
+ var _b = token.split('.'), algorithm = _b[0], payload = _b[1], signature = _b[2];
2073
2074
  if (algorithm === undefined ||
2074
2075
  payload === undefined ||
2075
2076
  signature === undefined) {
@@ -2085,7 +2086,7 @@ function _parseToken(token) {
2085
2086
  return JSON.parse(decoded);
2086
2087
  }
2087
2088
  catch (e) {
2088
- _logError('Caught error parsing JWT payload as JSON', e);
2089
+ _logError('Caught error parsing JWT payload as JSON', (_a = e) === null || _a === void 0 ? void 0 : _a.toString());
2089
2090
  return null;
2090
2091
  }
2091
2092
  }
@@ -2229,20 +2230,21 @@ var ProactiveRefresh = /** @class */ (function () {
2229
2230
  }); }, interval);
2230
2231
  };
2231
2232
  ProactiveRefresh.prototype.iteration = function () {
2233
+ var _a;
2232
2234
  return __awaiter(this, void 0, void 0, function () {
2233
2235
  var e_1;
2234
- return __generator(this, function (_a) {
2235
- switch (_a.label) {
2236
+ return __generator(this, function (_b) {
2237
+ switch (_b.label) {
2236
2238
  case 0:
2237
- _a.trys.push([0, 2, , 3]);
2239
+ _b.trys.push([0, 2, , 3]);
2238
2240
  return [4 /*yield*/, this.user.getIdToken(true)];
2239
2241
  case 1:
2240
- _a.sent();
2242
+ _b.sent();
2241
2243
  return [3 /*break*/, 3];
2242
2244
  case 2:
2243
- e_1 = _a.sent();
2245
+ e_1 = _b.sent();
2244
2246
  // Only retry on network errors
2245
- if (e_1.code === "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2247
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
2246
2248
  this.schedule(/* wasError */ true);
2247
2249
  }
2248
2250
  return [2 /*return*/];
@@ -3205,7 +3207,8 @@ function _isWebOS(ua) {
3205
3207
  }
3206
3208
  function _isIOS(ua) {
3207
3209
  if (ua === void 0) { ua = getUA(); }
3208
- return /iphone|ipad|ipod/i.test(ua);
3210
+ return /iphone|ipad|ipod/i.test(ua) ||
3211
+ (/macintosh/i.test(ua) && /mobile/i.test(ua));
3209
3212
  }
3210
3213
  function _isIOS7Or8(ua) {
3211
3214
  if (ua === void 0) { ua = getUA(); }
@@ -3628,19 +3631,20 @@ var AuthImpl = /** @class */ (function () {
3628
3631
  });
3629
3632
  };
3630
3633
  AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
3634
+ var _a;
3631
3635
  return __awaiter(this, void 0, void 0, function () {
3632
3636
  var e_4;
3633
- return __generator(this, function (_a) {
3634
- switch (_a.label) {
3637
+ return __generator(this, function (_b) {
3638
+ switch (_b.label) {
3635
3639
  case 0:
3636
- _a.trys.push([0, 2, , 3]);
3640
+ _b.trys.push([0, 2, , 3]);
3637
3641
  return [4 /*yield*/, _reloadWithoutSaving(user)];
3638
3642
  case 1:
3639
- _a.sent();
3643
+ _b.sent();
3640
3644
  return [3 /*break*/, 3];
3641
3645
  case 2:
3642
- e_4 = _a.sent();
3643
- if (e_4.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
3646
+ e_4 = _b.sent();
3647
+ if (((_a = e_4) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
3644
3648
  // Something's wrong with the user's token. Log them out and remove
3645
3649
  // them from storage
3646
3650
  return [2 /*return*/, this.directlySetCurrentUser(null)];
@@ -6257,20 +6261,21 @@ function _assertLinkedStatus(expected, user, provider) {
6257
6261
  * limitations under the License.
6258
6262
  */
6259
6263
  function _reauthenticate(user, credential, bypassAuthState) {
6264
+ var _a;
6260
6265
  if (bypassAuthState === void 0) { bypassAuthState = false; }
6261
6266
  return __awaiter(this, void 0, void 0, function () {
6262
6267
  var auth, operationType, response, parsed, localId, e_1;
6263
- return __generator(this, function (_a) {
6264
- switch (_a.label) {
6268
+ return __generator(this, function (_b) {
6269
+ switch (_b.label) {
6265
6270
  case 0:
6266
6271
  auth = user.auth;
6267
6272
  operationType = "reauthenticate" /* REAUTHENTICATE */;
6268
- _a.label = 1;
6273
+ _b.label = 1;
6269
6274
  case 1:
6270
- _a.trys.push([1, 3, , 4]);
6275
+ _b.trys.push([1, 3, , 4]);
6271
6276
  return [4 /*yield*/, _logoutIfInvalidated(user, _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user), bypassAuthState)];
6272
6277
  case 2:
6273
- response = _a.sent();
6278
+ response = _b.sent();
6274
6279
  _assert(response.idToken, auth, "internal-error" /* INTERNAL_ERROR */);
6275
6280
  parsed = _parseToken(response.idToken);
6276
6281
  _assert(parsed, auth, "internal-error" /* INTERNAL_ERROR */);
@@ -6278,9 +6283,9 @@ function _reauthenticate(user, credential, bypassAuthState) {
6278
6283
  _assert(user.uid === localId, auth, "user-mismatch" /* USER_MISMATCH */);
6279
6284
  return [2 /*return*/, UserCredentialImpl._forOperation(user, operationType, response)];
6280
6285
  case 3:
6281
- e_1 = _a.sent();
6286
+ e_1 = _b.sent();
6282
6287
  // Convert user deleted error into user mismatch
6283
- if ((e_1 === null || e_1 === void 0 ? void 0 : e_1.code) === "auth/" + "user-not-found" /* USER_DELETED */) {
6288
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "user-not-found" /* USER_DELETED */) {
6284
6289
  _fail(auth, "user-mismatch" /* USER_MISMATCH */);
6285
6290
  }
6286
6291
  throw e_1;
@@ -7806,21 +7811,22 @@ var MultiFactorUserImpl = /** @class */ (function () {
7806
7811
  });
7807
7812
  };
7808
7813
  MultiFactorUserImpl.prototype.unenroll = function (infoOrUid) {
7814
+ var _a;
7809
7815
  return __awaiter(this, void 0, void 0, function () {
7810
7816
  var mfaEnrollmentId, idToken, idTokenResponse, e_1;
7811
- return __generator(this, function (_a) {
7812
- switch (_a.label) {
7817
+ return __generator(this, function (_b) {
7818
+ switch (_b.label) {
7813
7819
  case 0:
7814
7820
  mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;
7815
7821
  return [4 /*yield*/, this.user.getIdToken()];
7816
7822
  case 1:
7817
- idToken = _a.sent();
7823
+ idToken = _b.sent();
7818
7824
  return [4 /*yield*/, _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {
7819
7825
  idToken: idToken,
7820
7826
  mfaEnrollmentId: mfaEnrollmentId
7821
7827
  }))];
7822
7828
  case 2:
7823
- idTokenResponse = _a.sent();
7829
+ idTokenResponse = _b.sent();
7824
7830
  // Remove the second factor from the user's list.
7825
7831
  this.enrolledFactors = this.enrolledFactors.filter(function (_a) {
7826
7832
  var uid = _a.uid;
@@ -7836,17 +7842,17 @@ var MultiFactorUserImpl = /** @class */ (function () {
7836
7842
  // the tokenResponse may be empty. If the tokens were not updated (and they
7837
7843
  // are now invalid), reloading the user will discover this and invalidate
7838
7844
  // the user's state accordingly.
7839
- _a.sent();
7840
- _a.label = 4;
7845
+ _b.sent();
7846
+ _b.label = 4;
7841
7847
  case 4:
7842
- _a.trys.push([4, 6, , 7]);
7848
+ _b.trys.push([4, 6, , 7]);
7843
7849
  return [4 /*yield*/, this.user.reload()];
7844
7850
  case 5:
7845
- _a.sent();
7851
+ _b.sent();
7846
7852
  return [3 /*break*/, 7];
7847
7853
  case 6:
7848
- e_1 = _a.sent();
7849
- if (e_1.code !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
7854
+ e_1 = _b.sent();
7855
+ if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
7850
7856
  throw e_1;
7851
7857
  }
7852
7858
  return [3 /*break*/, 7];
@@ -7877,7 +7883,7 @@ function multiFactor(user) {
7877
7883
  }
7878
7884
 
7879
7885
  var name = "@firebase/auth";
7880
- var version = "0.20.3";
7886
+ var version = "0.20.4-canary.b60cf76e1";
7881
7887
 
7882
7888
  /**
7883
7889
  * @license
@@ -10024,4 +10030,4 @@ function generateNoEvent() {
10024
10030
  }
10025
10031
 
10026
10032
  export { signInWithEmailLink as $, ActionCodeOperation as A, FacebookAuthProvider as B, GithubAuthProvider as C, OAuthProvider as D, EmailAuthCredential as E, FactorId as F, GoogleAuthProvider as G, SAMLAuthProvider as H, signInAnonymously as I, signInWithCredential as J, linkWithCredential as K, reauthenticateWithCredential as L, signInWithCustomToken as M, sendPasswordResetEmail as N, OperationType as O, ProviderId as P, confirmPasswordReset as Q, applyActionCode as R, SignInMethod as S, TwitterAuthProvider as T, checkActionCode as U, verifyPasswordResetCode as V, createUserWithEmailAndPassword as W, signInWithEmailAndPassword as X, sendSignInLinkToEmail as Y, isSignInWithEmailLink as Z, _signInWithRedirect as _, _reauthenticateWithRedirect as a, fetchSignInMethodsForEmail as a0, sendEmailVerification as a1, verifyBeforeUpdateEmail as a2, ActionCodeURL as a3, parseActionCodeURL as a4, updateProfile as a5, updateEmail as a6, updatePassword as a7, getIdToken as a8, getIdTokenResult as a9, _getCurrentUrl as aA, _emulatorUrl as aB, _isChromeIOS as aC, _isFirefox as aD, _isIOSStandalone as aE, _isMobileBrowser as aF, _isSafari as aG, _isIOS as aH, _getRedirectResult as aI, _overrideRedirectResult as aJ, _getRedirectUrl as aK, _setWindowLocation as aL, AuthEventManager as aM, debugFail as aN, finalizeEnrollPhoneMfa as aO, _persistenceKeyName as aP, UserImpl as aQ, _getInstance as aR, AuthImpl as aS, _getClientVersion as aT, FetchProvider as aU, SAMLAuthCredential as aV, signInWithRedirect as aW, linkWithRedirect as aX, reauthenticateWithRedirect as aY, unlink as aa, getAdditionalUserInfo as ab, reload as ac, getMultiFactorResolver as ad, multiFactor as ae, _performApiRequest as af, _addTidIfNecessary as ag, _createError as ah, _assert as ai, Delay as aj, _window as ak, _isHttpOrHttps as al, _isWorker as am, _castAuth as an, sendPhoneVerificationCode as ao, startEnrollPhoneMfa as ap, _assertLinkedStatus as aq, _link$1 as ar, debugAssert as as, _generateEventId as at, AbstractPopupRedirectOperation as au, _assertInstanceOf as av, _withDefaultResolver as aw, FederatedAuthProvider as ax, _fail as ay, _getProjectConfig as az, _linkWithRedirect as b, indexedDBLocalPersistence as c, cordovaPopupRedirectResolver as d, browserLocalPersistence as e, browserSessionPersistence as f, getRedirectResult as g, beforeAuthStateChanged as h, initializeAuth as i, onAuthStateChanged as j, updateCurrentUser as k, signOut as l, deleteUser as m, debugErrorMap as n, onIdTokenChanged as o, prodErrorMap as p, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as q, registerAuth as r, setPersistence as s, connectAuthEmulator as t, useDeviceLanguage as u, AuthCredential as v, OAuthCredential as w, PhoneAuthCredential as x, inMemoryPersistence as y, EmailAuthProvider as z };
10027
- //# sourceMappingURL=popup_redirect-9ed330a1.js.map
10033
+ //# sourceMappingURL=popup_redirect-ce1dc327.js.map