@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
@@ -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;
@@ -2167,6 +2169,7 @@ class AuthMiddlewareQueue {
2167
2169
  };
2168
2170
  }
2169
2171
  async runMiddleware(nextUser) {
2172
+ var _a;
2170
2173
  if (this.auth.currentUser === nextUser) {
2171
2174
  return;
2172
2175
  }
@@ -2192,7 +2195,7 @@ class AuthMiddlewareQueue {
2192
2195
  }
2193
2196
  catch (_) { /* swallow error */ }
2194
2197
  }
2195
- throw this.auth._errorFactory.create("login-blocked" /* LOGIN_BLOCKED */, { originalMessage: e.message });
2198
+ throw this.auth._errorFactory.create("login-blocked" /* LOGIN_BLOCKED */, { originalMessage: (_a = e) === null || _a === void 0 ? void 0 : _a.message });
2196
2199
  }
2197
2200
  }
2198
2201
  }
@@ -2390,11 +2393,12 @@ class AuthImpl {
2390
2393
  return result;
2391
2394
  }
2392
2395
  async reloadAndSetCurrentUserOrClear(user) {
2396
+ var _a;
2393
2397
  try {
2394
2398
  await _reloadWithoutSaving(user);
2395
2399
  }
2396
2400
  catch (e) {
2397
- 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 */}`) {
2398
2402
  // Something's wrong with the user's token. Log them out and remove
2399
2403
  // them from storage
2400
2404
  return this.directlySetCurrentUser(null);
@@ -4666,6 +4670,7 @@ async function _assertLinkedStatus(expected, user, provider) {
4666
4670
  * limitations under the License.
4667
4671
  */
4668
4672
  async function _reauthenticate(user, credential, bypassAuthState = false) {
4673
+ var _a;
4669
4674
  const { auth } = user;
4670
4675
  const operationType = "reauthenticate" /* REAUTHENTICATE */;
4671
4676
  try {
@@ -4679,7 +4684,7 @@ async function _reauthenticate(user, credential, bypassAuthState = false) {
4679
4684
  }
4680
4685
  catch (e) {
4681
4686
  // Convert user deleted error into user mismatch
4682
- 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 */}`) {
4683
4688
  _fail(auth, "user-mismatch" /* USER_MISMATCH */);
4684
4689
  }
4685
4690
  throw e;
@@ -5926,6 +5931,7 @@ class MultiFactorUserImpl {
5926
5931
  return this.user.reload();
5927
5932
  }
5928
5933
  async unenroll(infoOrUid) {
5934
+ var _a;
5929
5935
  const mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;
5930
5936
  const idToken = await this.user.getIdToken();
5931
5937
  const idTokenResponse = await _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {
@@ -5943,7 +5949,7 @@ class MultiFactorUserImpl {
5943
5949
  await this.user.reload();
5944
5950
  }
5945
5951
  catch (e) {
5946
- 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 */}`) {
5947
5953
  throw e;
5948
5954
  }
5949
5955
  }
@@ -7804,7 +7810,7 @@ class PhoneAuthProvider {
7804
7810
  * auth.currentUser,
7805
7811
  * PhoneAuthProvider.credential(verificationId, code));
7806
7812
  * } catch (e) {
7807
- * if (e.code === 'auth/account-exists-with-different-credential') {
7813
+ * if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {
7808
7814
  * const cred = PhoneAuthProvider.credentialFromError(e);
7809
7815
  * await linkWithCredential(auth.currentUser, cred);
7810
7816
  * }
@@ -9276,7 +9282,7 @@ class PhoneMultiFactorGenerator {
9276
9282
  PhoneMultiFactorGenerator.FACTOR_ID = 'phone';
9277
9283
 
9278
9284
  var name = "@firebase/auth";
9279
- var version = "0.20.2";
9285
+ var version = "0.20.3-canary.8e952e2ee";
9280
9286
 
9281
9287
  /**
9282
9288
  * @license
@@ -9467,4 +9473,4 @@ function getAuth(app = getApp()) {
9467
9473
  registerAuth("Browser" /* BROWSER */);
9468
9474
 
9469
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 };
9470
- //# sourceMappingURL=index-ccf9d100.js.map
9476
+ //# sourceMappingURL=index-73de905c.js.map