@firebase/auth 0.19.3 → 0.19.4-canary.a185b1431
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 +8 -0
- package/dist/auth-public.d.ts +1 -2
- package/dist/auth.d.ts +2 -3
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +9 -3
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-1cde31c6.js → popup_redirect-cf1fe24c.js} +82 -48
- package/dist/cordova/popup_redirect-cf1fe24c.js.map +1 -0
- package/dist/cordova/src/api/index.d.ts +2 -1
- package/dist/cordova/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/cordova/src/model/auth.d.ts +1 -1
- package/dist/cordova/src/model/public_types.d.ts +1 -2
- package/dist/esm2017/{index-8593558d.js → index-e0ba4728.js} +30 -16
- package/dist/esm2017/index-e0ba4728.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/api/index.d.ts +2 -1
- package/dist/esm2017/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/esm2017/src/model/auth.d.ts +1 -1
- package/dist/esm2017/src/model/public_types.d.ts +1 -2
- package/dist/esm5/{index-4f7e1a18.js → index-c216c700.js} +89 -49
- package/dist/esm5/index-c216c700.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/api/index.d.ts +2 -1
- package/dist/esm5/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/esm5/src/model/auth.d.ts +1 -1
- package/dist/esm5/src/model/public_types.d.ts +1 -2
- package/dist/index.webworker.esm5.js +81 -47
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-057dcc31.js → index-0ffb6e81.js} +82 -48
- package/dist/node/index-0ffb6e81.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/src/api/index.d.ts +2 -1
- package/dist/node/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/node/src/model/auth.d.ts +1 -1
- package/dist/node/src/model/public_types.d.ts +1 -2
- package/dist/node-esm/{index-c327074d.js → index-620dc5a9.js} +24 -15
- package/dist/node-esm/index-620dc5a9.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/api/index.d.ts +2 -1
- package/dist/node-esm/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/node-esm/src/model/auth.d.ts +1 -1
- package/dist/node-esm/src/model/public_types.d.ts +1 -2
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +8 -2
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-4c7624c1.js → phone-bf918508.js} +82 -48
- package/dist/rn/phone-bf918508.js.map +1 -0
- package/dist/rn/src/api/index.d.ts +2 -1
- package/dist/rn/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/rn/src/model/auth.d.ts +1 -1
- package/dist/rn/src/model/public_types.d.ts +1 -2
- package/dist/src/api/index.d.ts +2 -1
- package/dist/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/src/model/auth.d.ts +1 -1
- package/dist/src/model/public_types.d.ts +1 -2
- package/package.json +8 -7
- package/dist/cordova/popup_redirect-1cde31c6.js.map +0 -1
- package/dist/esm2017/index-8593558d.js.map +0 -1
- package/dist/esm5/index-4f7e1a18.js.map +0 -1
- package/dist/node/index-057dcc31.js.map +0 -1
- package/dist/node-esm/index-c327074d.js.map +0 -1
- package/dist/rn/phone-4c7624c1.js.map +0 -1
|
@@ -1757,30 +1757,38 @@ function _addTidIfNecessary(auth, request) {
|
|
|
1757
1757
|
function _performApiRequest(auth, method, path, request, customErrorMap) {
|
|
1758
1758
|
if (customErrorMap === void 0) { customErrorMap = {}; }
|
|
1759
1759
|
return __awaiter(this, void 0, void 0, function () {
|
|
1760
|
+
var _this = this;
|
|
1760
1761
|
return __generator(this, function (_a) {
|
|
1761
|
-
return [2 /*return*/, _performFetchWithErrorHandling(auth, customErrorMap, function () {
|
|
1762
|
-
var body
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1762
|
+
return [2 /*return*/, _performFetchWithErrorHandling(auth, customErrorMap, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1763
|
+
var body, params, query, headers;
|
|
1764
|
+
return __generator(this, function (_a) {
|
|
1765
|
+
switch (_a.label) {
|
|
1766
|
+
case 0:
|
|
1767
|
+
body = {};
|
|
1768
|
+
params = {};
|
|
1769
|
+
if (request) {
|
|
1770
|
+
if (method === "GET" /* GET */) {
|
|
1771
|
+
params = request;
|
|
1772
|
+
}
|
|
1773
|
+
else {
|
|
1774
|
+
body = {
|
|
1775
|
+
body: JSON.stringify(request)
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
query = querystring(__assign({ key: auth.config.apiKey }, params)).slice(1);
|
|
1780
|
+
return [4 /*yield*/, auth._getAdditionalHeaders()];
|
|
1781
|
+
case 1:
|
|
1782
|
+
headers = _a.sent();
|
|
1783
|
+
headers["Content-Type" /* CONTENT_TYPE */] = 'application/json';
|
|
1784
|
+
if (auth.languageCode) {
|
|
1785
|
+
headers["X-Firebase-Locale" /* X_FIREBASE_LOCALE */] = auth.languageCode;
|
|
1786
|
+
}
|
|
1787
|
+
return [2 /*return*/, FetchProvider.fetch()(_getFinalTarget(auth, auth.config.apiHost, path, query), __assign({ method: method,
|
|
1788
|
+
headers: headers, referrerPolicy: 'no-referrer' }, body))];
|
|
1772
1789
|
}
|
|
1773
|
-
}
|
|
1774
|
-
|
|
1775
|
-
var headers = new (FetchProvider.headers())();
|
|
1776
|
-
headers.set("Content-Type" /* CONTENT_TYPE */, 'application/json');
|
|
1777
|
-
headers.set("X-Client-Version" /* X_CLIENT_VERSION */, auth._getSdkClientVersion());
|
|
1778
|
-
if (auth.languageCode) {
|
|
1779
|
-
headers.set("X-Firebase-Locale" /* X_FIREBASE_LOCALE */, auth.languageCode);
|
|
1780
|
-
}
|
|
1781
|
-
return FetchProvider.fetch()(_getFinalTarget(auth, auth.config.apiHost, path, query), __assign({ method: method,
|
|
1782
|
-
headers: headers, referrerPolicy: 'no-referrer' }, body));
|
|
1783
|
-
})];
|
|
1790
|
+
});
|
|
1791
|
+
}); })];
|
|
1784
1792
|
});
|
|
1785
1793
|
});
|
|
1786
1794
|
}
|
|
@@ -2411,24 +2419,32 @@ function extractProviderData(providers) {
|
|
|
2411
2419
|
function requestStsToken(auth, refreshToken) {
|
|
2412
2420
|
return __awaiter(this, void 0, void 0, function () {
|
|
2413
2421
|
var response;
|
|
2422
|
+
var _this = this;
|
|
2414
2423
|
return __generator(this, function (_a) {
|
|
2415
2424
|
switch (_a.label) {
|
|
2416
|
-
case 0: return [4 /*yield*/, _performFetchWithErrorHandling(auth, {}, function () {
|
|
2417
|
-
var body
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2425
|
+
case 0: return [4 /*yield*/, _performFetchWithErrorHandling(auth, {}, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2426
|
+
var body, _a, tokenApiHost, apiKey, url, headers;
|
|
2427
|
+
return __generator(this, function (_b) {
|
|
2428
|
+
switch (_b.label) {
|
|
2429
|
+
case 0:
|
|
2430
|
+
body = querystring({
|
|
2431
|
+
'grant_type': 'refresh_token',
|
|
2432
|
+
'refresh_token': refreshToken
|
|
2433
|
+
}).slice(1);
|
|
2434
|
+
_a = auth.config, tokenApiHost = _a.tokenApiHost, apiKey = _a.apiKey;
|
|
2435
|
+
url = _getFinalTarget(auth, tokenApiHost, "/v1/token" /* TOKEN */, "key=" + apiKey);
|
|
2436
|
+
return [4 /*yield*/, auth._getAdditionalHeaders()];
|
|
2437
|
+
case 1:
|
|
2438
|
+
headers = _b.sent();
|
|
2439
|
+
headers["Content-Type" /* CONTENT_TYPE */] = 'application/x-www-form-urlencoded';
|
|
2440
|
+
return [2 /*return*/, FetchProvider.fetch()(url, {
|
|
2441
|
+
method: "POST" /* POST */,
|
|
2442
|
+
headers: headers,
|
|
2443
|
+
body: body
|
|
2444
|
+
})];
|
|
2445
|
+
}
|
|
2430
2446
|
});
|
|
2431
|
-
})];
|
|
2447
|
+
}); })];
|
|
2432
2448
|
case 1:
|
|
2433
2449
|
response = _a.sent();
|
|
2434
2450
|
// The response comes back in snake_case. Convert to camel:
|
|
@@ -3335,13 +3351,19 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3335
3351
|
if (this._deleted) {
|
|
3336
3352
|
return [2 /*return*/];
|
|
3337
3353
|
}
|
|
3338
|
-
if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/,
|
|
3339
|
-
|
|
3354
|
+
if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/, 5];
|
|
3355
|
+
_d.label = 2;
|
|
3340
3356
|
case 2:
|
|
3357
|
+
_d.trys.push([2, 4, , 5]);
|
|
3358
|
+
return [4 /*yield*/, this._popupRedirectResolver._initialize(this)];
|
|
3359
|
+
case 3:
|
|
3341
3360
|
_d.sent();
|
|
3342
|
-
|
|
3343
|
-
case 3: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
|
|
3361
|
+
return [3 /*break*/, 5];
|
|
3344
3362
|
case 4:
|
|
3363
|
+
_d.sent();
|
|
3364
|
+
return [3 /*break*/, 5];
|
|
3365
|
+
case 5: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
|
|
3366
|
+
case 6:
|
|
3345
3367
|
_d.sent();
|
|
3346
3368
|
this.lastNotifiedUid = ((_c = this.currentUser) === null || _c === void 0 ? void 0 : _c.uid) || null;
|
|
3347
3369
|
if (this._deleted) {
|
|
@@ -3482,7 +3504,7 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3482
3504
|
};
|
|
3483
3505
|
AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
|
|
3484
3506
|
return __awaiter(this, void 0, void 0, function () {
|
|
3485
|
-
var
|
|
3507
|
+
var e_3;
|
|
3486
3508
|
return __generator(this, function (_a) {
|
|
3487
3509
|
switch (_a.label) {
|
|
3488
3510
|
case 0:
|
|
@@ -3492,8 +3514,8 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3492
3514
|
_a.sent();
|
|
3493
3515
|
return [3 /*break*/, 3];
|
|
3494
3516
|
case 2:
|
|
3495
|
-
|
|
3496
|
-
if (
|
|
3517
|
+
e_3 = _a.sent();
|
|
3518
|
+
if (e_3.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
|
|
3497
3519
|
// Something's wrong with the user's token. Log them out and remove
|
|
3498
3520
|
// them from storage
|
|
3499
3521
|
return [2 /*return*/, this.directlySetCurrentUser(null)];
|
|
@@ -3802,8 +3824,20 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3802
3824
|
AuthImpl.prototype._getFrameworks = function () {
|
|
3803
3825
|
return this.frameworks;
|
|
3804
3826
|
};
|
|
3805
|
-
AuthImpl.prototype.
|
|
3806
|
-
return this
|
|
3827
|
+
AuthImpl.prototype._getAdditionalHeaders = function () {
|
|
3828
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3829
|
+
var headers;
|
|
3830
|
+
var _a;
|
|
3831
|
+
return __generator(this, function (_b) {
|
|
3832
|
+
headers = (_a = {},
|
|
3833
|
+
_a["X-Client-Version" /* X_CLIENT_VERSION */] = this.clientVersion,
|
|
3834
|
+
_a);
|
|
3835
|
+
if (this.app.options.appId) {
|
|
3836
|
+
headers["X-Firebase-gmpid" /* X_FIREBASE_GMPID */] = this.app.options.appId;
|
|
3837
|
+
}
|
|
3838
|
+
return [2 /*return*/, headers];
|
|
3839
|
+
});
|
|
3840
|
+
});
|
|
3807
3841
|
};
|
|
3808
3842
|
return AuthImpl;
|
|
3809
3843
|
}());
|
|
@@ -7667,7 +7701,7 @@ function multiFactor(user) {
|
|
|
7667
7701
|
}
|
|
7668
7702
|
|
|
7669
7703
|
var name = "@firebase/auth";
|
|
7670
|
-
var version = "0.19.
|
|
7704
|
+
var version = "0.19.4-canary.a185b1431";
|
|
7671
7705
|
|
|
7672
7706
|
/**
|
|
7673
7707
|
* @license
|
|
@@ -9809,4 +9843,4 @@ function generateNoEvent() {
|
|
|
9809
9843
|
}
|
|
9810
9844
|
|
|
9811
9845
|
export { fetchSignInMethodsForEmail as $, ActionCodeOperation as A, GithubAuthProvider as B, OAuthProvider as C, SAMLAuthProvider as D, EmailAuthCredential as E, FactorId as F, GoogleAuthProvider as G, signInAnonymously as H, signInWithCredential as I, linkWithCredential as J, reauthenticateWithCredential as K, signInWithCustomToken as L, sendPasswordResetEmail as M, confirmPasswordReset as N, OperationType as O, ProviderId as P, applyActionCode as Q, checkActionCode as R, SignInMethod as S, TwitterAuthProvider as T, verifyPasswordResetCode as U, createUserWithEmailAndPassword as V, signInWithEmailAndPassword as W, sendSignInLinkToEmail as X, isSignInWithEmailLink as Y, signInWithEmailLink as Z, _signInWithRedirect as _, _reauthenticateWithRedirect as a, sendEmailVerification as a0, verifyBeforeUpdateEmail as a1, ActionCodeURL as a2, parseActionCodeURL as a3, updateProfile as a4, updateEmail as a5, updatePassword as a6, getIdToken as a7, getIdTokenResult as a8, unlink as a9, _emulatorUrl as aA, _isChromeIOS as aB, _isFirefox as aC, _isIOSStandalone as aD, _isMobileBrowser as aE, _isSafari as aF, _isIOS as aG, _getRedirectResult as aH, _getRedirectUrl as aI, _setWindowLocation as aJ, AuthEventManager as aK, debugFail as aL, finalizeEnrollPhoneMfa as aM, _persistenceKeyName as aN, UserImpl as aO, _getInstance as aP, AuthImpl as aQ, _getClientVersion as aR, FetchProvider as aS, SAMLAuthCredential as aT, signInWithRedirect as aU, linkWithRedirect as aV, reauthenticateWithRedirect as aW, getAdditionalUserInfo as aa, reload as ab, getMultiFactorResolver as ac, multiFactor as ad, _performApiRequest as ae, _addTidIfNecessary as af, _createError as ag, _assert as ah, Delay as ai, _window as aj, _isHttpOrHttps as ak, _isWorker as al, _castAuth as am, sendPhoneVerificationCode as an, startEnrollPhoneMfa as ao, _assertLinkedStatus as ap, _link$1 as aq, debugAssert as ar, _generateEventId as as, AbstractPopupRedirectOperation as at, _assertInstanceOf as au, _withDefaultResolver as av, FederatedAuthProvider as aw, _fail as ax, _getProjectConfig as ay, _getCurrentUrl as az, _linkWithRedirect as b, indexedDBLocalPersistence as c, cordovaPopupRedirectResolver as d, browserLocalPersistence as e, browserSessionPersistence as f, getRedirectResult as g, onAuthStateChanged as h, initializeAuth as i, updateCurrentUser as j, signOut as k, deleteUser as l, debugErrorMap as m, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as n, onIdTokenChanged as o, prodErrorMap as p, connectAuthEmulator as q, registerAuth as r, setPersistence as s, AuthCredential as t, useDeviceLanguage as u, OAuthCredential as v, PhoneAuthCredential as w, inMemoryPersistence as x, EmailAuthProvider as y, FacebookAuthProvider as z };
|
|
9812
|
-
//# sourceMappingURL=popup_redirect-
|
|
9846
|
+
//# sourceMappingURL=popup_redirect-cf1fe24c.js.map
|