@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.
- package/CHANGELOG.md +9 -0
- package/dist/auth-public.d.ts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +3 -3
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-9ed330a1.js → popup_redirect-afabf63c.js} +38 -33
- package/dist/cordova/popup_redirect-afabf63c.js.map +1 -0
- package/dist/cordova/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/esm2017/{index-69ab4e3a.js → index-9e3ee486.js} +13 -8
- package/dist/esm2017/index-9e3ee486.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/esm5/{index-81005f8a.js → index-95f20717.js} +39 -34
- package/dist/esm5/index-95f20717.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/index.webworker.esm5.js +37 -32
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-007f80f6.js → index-26342bb1.js} +38 -33
- package/dist/node/index-26342bb1.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/node-esm/{index-b1f59f63.js → index-6f071fc8.js} +12 -7
- package/dist/node-esm/index-6f071fc8.js.map +1 -0
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +1 -1
- package/dist/rn/{phone-d791a05d.js → phone-d23325d1.js} +39 -34
- package/dist/rn/phone-d23325d1.js.map +1 -0
- package/dist/rn/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/src/platform_browser/providers/phone.d.ts +1 -1
- package/package.json +5 -5
- package/dist/cordova/popup_redirect-9ed330a1.js.map +0 -1
- package/dist/esm2017/index-69ab4e3a.js.map +0 -1
- package/dist/esm5/index-81005f8a.js.map +0 -1
- package/dist/node/index-007f80f6.js.map +0 -1
- package/dist/node-esm/index-b1f59f63.js.map +0 -1
- 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
|
|
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 (
|
|
2235
|
-
switch (
|
|
2236
|
+
return __generator(this, function (_b) {
|
|
2237
|
+
switch (_b.label) {
|
|
2236
2238
|
case 0:
|
|
2237
|
-
|
|
2239
|
+
_b.trys.push([0, 2, , 3]);
|
|
2238
2240
|
return [4 /*yield*/, this.user.getIdToken(true)];
|
|
2239
2241
|
case 1:
|
|
2240
|
-
|
|
2242
|
+
_b.sent();
|
|
2241
2243
|
return [3 /*break*/, 3];
|
|
2242
2244
|
case 2:
|
|
2243
|
-
e_1 =
|
|
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*/];
|
|
@@ -3628,19 +3630,20 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3628
3630
|
});
|
|
3629
3631
|
};
|
|
3630
3632
|
AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
|
|
3633
|
+
var _a;
|
|
3631
3634
|
return __awaiter(this, void 0, void 0, function () {
|
|
3632
3635
|
var e_4;
|
|
3633
|
-
return __generator(this, function (
|
|
3634
|
-
switch (
|
|
3636
|
+
return __generator(this, function (_b) {
|
|
3637
|
+
switch (_b.label) {
|
|
3635
3638
|
case 0:
|
|
3636
|
-
|
|
3639
|
+
_b.trys.push([0, 2, , 3]);
|
|
3637
3640
|
return [4 /*yield*/, _reloadWithoutSaving(user)];
|
|
3638
3641
|
case 1:
|
|
3639
|
-
|
|
3642
|
+
_b.sent();
|
|
3640
3643
|
return [3 /*break*/, 3];
|
|
3641
3644
|
case 2:
|
|
3642
|
-
e_4 =
|
|
3643
|
-
if (e_4.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
|
|
3645
|
+
e_4 = _b.sent();
|
|
3646
|
+
if (((_a = e_4) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
|
|
3644
3647
|
// Something's wrong with the user's token. Log them out and remove
|
|
3645
3648
|
// them from storage
|
|
3646
3649
|
return [2 /*return*/, this.directlySetCurrentUser(null)];
|
|
@@ -6257,20 +6260,21 @@ function _assertLinkedStatus(expected, user, provider) {
|
|
|
6257
6260
|
* limitations under the License.
|
|
6258
6261
|
*/
|
|
6259
6262
|
function _reauthenticate(user, credential, bypassAuthState) {
|
|
6263
|
+
var _a;
|
|
6260
6264
|
if (bypassAuthState === void 0) { bypassAuthState = false; }
|
|
6261
6265
|
return __awaiter(this, void 0, void 0, function () {
|
|
6262
6266
|
var auth, operationType, response, parsed, localId, e_1;
|
|
6263
|
-
return __generator(this, function (
|
|
6264
|
-
switch (
|
|
6267
|
+
return __generator(this, function (_b) {
|
|
6268
|
+
switch (_b.label) {
|
|
6265
6269
|
case 0:
|
|
6266
6270
|
auth = user.auth;
|
|
6267
6271
|
operationType = "reauthenticate" /* REAUTHENTICATE */;
|
|
6268
|
-
|
|
6272
|
+
_b.label = 1;
|
|
6269
6273
|
case 1:
|
|
6270
|
-
|
|
6274
|
+
_b.trys.push([1, 3, , 4]);
|
|
6271
6275
|
return [4 /*yield*/, _logoutIfInvalidated(user, _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user), bypassAuthState)];
|
|
6272
6276
|
case 2:
|
|
6273
|
-
response =
|
|
6277
|
+
response = _b.sent();
|
|
6274
6278
|
_assert(response.idToken, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
6275
6279
|
parsed = _parseToken(response.idToken);
|
|
6276
6280
|
_assert(parsed, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
@@ -6278,9 +6282,9 @@ function _reauthenticate(user, credential, bypassAuthState) {
|
|
|
6278
6282
|
_assert(user.uid === localId, auth, "user-mismatch" /* USER_MISMATCH */);
|
|
6279
6283
|
return [2 /*return*/, UserCredentialImpl._forOperation(user, operationType, response)];
|
|
6280
6284
|
case 3:
|
|
6281
|
-
e_1 =
|
|
6285
|
+
e_1 = _b.sent();
|
|
6282
6286
|
// Convert user deleted error into user mismatch
|
|
6283
|
-
if ((e_1 === null ||
|
|
6287
|
+
if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "user-not-found" /* USER_DELETED */) {
|
|
6284
6288
|
_fail(auth, "user-mismatch" /* USER_MISMATCH */);
|
|
6285
6289
|
}
|
|
6286
6290
|
throw e_1;
|
|
@@ -7806,21 +7810,22 @@ var MultiFactorUserImpl = /** @class */ (function () {
|
|
|
7806
7810
|
});
|
|
7807
7811
|
};
|
|
7808
7812
|
MultiFactorUserImpl.prototype.unenroll = function (infoOrUid) {
|
|
7813
|
+
var _a;
|
|
7809
7814
|
return __awaiter(this, void 0, void 0, function () {
|
|
7810
7815
|
var mfaEnrollmentId, idToken, idTokenResponse, e_1;
|
|
7811
|
-
return __generator(this, function (
|
|
7812
|
-
switch (
|
|
7816
|
+
return __generator(this, function (_b) {
|
|
7817
|
+
switch (_b.label) {
|
|
7813
7818
|
case 0:
|
|
7814
7819
|
mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;
|
|
7815
7820
|
return [4 /*yield*/, this.user.getIdToken()];
|
|
7816
7821
|
case 1:
|
|
7817
|
-
idToken =
|
|
7822
|
+
idToken = _b.sent();
|
|
7818
7823
|
return [4 /*yield*/, _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {
|
|
7819
7824
|
idToken: idToken,
|
|
7820
7825
|
mfaEnrollmentId: mfaEnrollmentId
|
|
7821
7826
|
}))];
|
|
7822
7827
|
case 2:
|
|
7823
|
-
idTokenResponse =
|
|
7828
|
+
idTokenResponse = _b.sent();
|
|
7824
7829
|
// Remove the second factor from the user's list.
|
|
7825
7830
|
this.enrolledFactors = this.enrolledFactors.filter(function (_a) {
|
|
7826
7831
|
var uid = _a.uid;
|
|
@@ -7836,17 +7841,17 @@ var MultiFactorUserImpl = /** @class */ (function () {
|
|
|
7836
7841
|
// the tokenResponse may be empty. If the tokens were not updated (and they
|
|
7837
7842
|
// are now invalid), reloading the user will discover this and invalidate
|
|
7838
7843
|
// the user's state accordingly.
|
|
7839
|
-
|
|
7840
|
-
|
|
7844
|
+
_b.sent();
|
|
7845
|
+
_b.label = 4;
|
|
7841
7846
|
case 4:
|
|
7842
|
-
|
|
7847
|
+
_b.trys.push([4, 6, , 7]);
|
|
7843
7848
|
return [4 /*yield*/, this.user.reload()];
|
|
7844
7849
|
case 5:
|
|
7845
|
-
|
|
7850
|
+
_b.sent();
|
|
7846
7851
|
return [3 /*break*/, 7];
|
|
7847
7852
|
case 6:
|
|
7848
|
-
e_1 =
|
|
7849
|
-
if (e_1.code !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
|
|
7853
|
+
e_1 = _b.sent();
|
|
7854
|
+
if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
|
|
7850
7855
|
throw e_1;
|
|
7851
7856
|
}
|
|
7852
7857
|
return [3 /*break*/, 7];
|
|
@@ -7877,7 +7882,7 @@ function multiFactor(user) {
|
|
|
7877
7882
|
}
|
|
7878
7883
|
|
|
7879
7884
|
var name = "@firebase/auth";
|
|
7880
|
-
var version = "0.20.
|
|
7885
|
+
var version = "0.20.4-20220621210445";
|
|
7881
7886
|
|
|
7882
7887
|
/**
|
|
7883
7888
|
* @license
|
|
@@ -10024,4 +10029,4 @@ function generateNoEvent() {
|
|
|
10024
10029
|
}
|
|
10025
10030
|
|
|
10026
10031
|
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-
|
|
10032
|
+
//# sourceMappingURL=popup_redirect-afabf63c.js.map
|