@firebase/auth 0.20.3 → 0.20.4-20220621210445

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 +9 -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-afabf63c.js} +38 -33
  8. package/dist/cordova/popup_redirect-afabf63c.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-9e3ee486.js} +13 -8
  11. package/dist/esm2017/index-9e3ee486.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-95f20717.js} +39 -34
  16. package/dist/esm5/index-95f20717.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-26342bb1.js} +38 -33
  23. package/dist/node/index-26342bb1.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-6f071fc8.js} +12 -7
  28. package/dist/node-esm/index-6f071fc8.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-d23325d1.js} +39 -34
  35. package/dist/rn/phone-d23325d1.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 +5 -5
  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
@@ -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
  * }
@@ -1158,6 +1158,7 @@ function secondsStringToMilliseconds(seconds) {
1158
1158
  return Number(seconds) * 1000;
1159
1159
  }
1160
1160
  function _parseToken(token) {
1161
+ var _a;
1161
1162
  const [algorithm, payload, signature] = token.split('.');
1162
1163
  if (algorithm === undefined ||
1163
1164
  payload === undefined ||
@@ -1174,7 +1175,7 @@ function _parseToken(token) {
1174
1175
  return JSON.parse(decoded);
1175
1176
  }
1176
1177
  catch (e) {
1177
- _logError('Caught error parsing JWT payload as JSON', e);
1178
+ _logError('Caught error parsing JWT payload as JSON', (_a = e) === null || _a === void 0 ? void 0 : _a.toString());
1178
1179
  return null;
1179
1180
  }
1180
1181
  }
@@ -1295,12 +1296,13 @@ class ProactiveRefresh {
1295
1296
  }, interval);
1296
1297
  }
1297
1298
  async iteration() {
1299
+ var _a;
1298
1300
  try {
1299
1301
  await this.user.getIdToken(true);
1300
1302
  }
1301
1303
  catch (e) {
1302
1304
  // Only retry on network errors
1303
- if (e.code === `auth/${"network-request-failed" /* NETWORK_REQUEST_FAILED */}`) {
1305
+ if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) === `auth/${"network-request-failed" /* NETWORK_REQUEST_FAILED */}`) {
1304
1306
  this.schedule(/* wasError */ true);
1305
1307
  }
1306
1308
  return;
@@ -2391,11 +2393,12 @@ class AuthImpl {
2391
2393
  return result;
2392
2394
  }
2393
2395
  async reloadAndSetCurrentUserOrClear(user) {
2396
+ var _a;
2394
2397
  try {
2395
2398
  await _reloadWithoutSaving(user);
2396
2399
  }
2397
2400
  catch (e) {
2398
- if (e.code !== `auth/${"network-request-failed" /* NETWORK_REQUEST_FAILED */}`) {
2401
+ if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) !== `auth/${"network-request-failed" /* NETWORK_REQUEST_FAILED */}`) {
2399
2402
  // Something's wrong with the user's token. Log them out and remove
2400
2403
  // them from storage
2401
2404
  return this.directlySetCurrentUser(null);
@@ -4667,6 +4670,7 @@ async function _assertLinkedStatus(expected, user, provider) {
4667
4670
  * limitations under the License.
4668
4671
  */
4669
4672
  async function _reauthenticate(user, credential, bypassAuthState = false) {
4673
+ var _a;
4670
4674
  const { auth } = user;
4671
4675
  const operationType = "reauthenticate" /* REAUTHENTICATE */;
4672
4676
  try {
@@ -4680,7 +4684,7 @@ async function _reauthenticate(user, credential, bypassAuthState = false) {
4680
4684
  }
4681
4685
  catch (e) {
4682
4686
  // Convert user deleted error into user mismatch
4683
- if ((e === null || e === void 0 ? void 0 : e.code) === `auth/${"user-not-found" /* USER_DELETED */}`) {
4687
+ if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) === `auth/${"user-not-found" /* USER_DELETED */}`) {
4684
4688
  _fail(auth, "user-mismatch" /* USER_MISMATCH */);
4685
4689
  }
4686
4690
  throw e;
@@ -5927,6 +5931,7 @@ class MultiFactorUserImpl {
5927
5931
  return this.user.reload();
5928
5932
  }
5929
5933
  async unenroll(infoOrUid) {
5934
+ var _a;
5930
5935
  const mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;
5931
5936
  const idToken = await this.user.getIdToken();
5932
5937
  const idTokenResponse = await _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {
@@ -5944,7 +5949,7 @@ class MultiFactorUserImpl {
5944
5949
  await this.user.reload();
5945
5950
  }
5946
5951
  catch (e) {
5947
- if (e.code !== `auth/${"user-token-expired" /* TOKEN_EXPIRED */}`) {
5952
+ if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) !== `auth/${"user-token-expired" /* TOKEN_EXPIRED */}`) {
5948
5953
  throw e;
5949
5954
  }
5950
5955
  }
@@ -7805,7 +7810,7 @@ class PhoneAuthProvider {
7805
7810
  * auth.currentUser,
7806
7811
  * PhoneAuthProvider.credential(verificationId, code));
7807
7812
  * } catch (e) {
7808
- * if (e.code === 'auth/account-exists-with-different-credential') {
7813
+ * if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {
7809
7814
  * const cred = PhoneAuthProvider.credentialFromError(e);
7810
7815
  * await linkWithCredential(auth.currentUser, cred);
7811
7816
  * }
@@ -9277,7 +9282,7 @@ class PhoneMultiFactorGenerator {
9277
9282
  PhoneMultiFactorGenerator.FACTOR_ID = 'phone';
9278
9283
 
9279
9284
  var name = "@firebase/auth";
9280
- var version = "0.20.3";
9285
+ var version = "0.20.4-20220621210445";
9281
9286
 
9282
9287
  /**
9283
9288
  * @license
@@ -9468,4 +9473,4 @@ function getAuth(app = getApp()) {
9468
9473
  registerAuth("Browser" /* BROWSER */);
9469
9474
 
9470
9475
  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, AuthEventManager as aA, _getRedirectResult as aB, _overrideRedirectResult as aC, _clearRedirectOutcomes 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, _isIOS7Or8 as ap, debugAssert as aq, _isIOS as ar, _isAndroid as as, _fail as at, _getRedirectUrl as au, _getProjectConfig as av, _createError as aw, _assert as ax, _getInstance as ay, _persistenceKeyName 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 };
9471
- //# sourceMappingURL=index-69ab4e3a.js.map
9476
+ //# sourceMappingURL=index-9e3ee486.js.map