@firebase/auth 0.18.3 → 0.19.0
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 +16 -0
- package/dist/auth-public.d.ts +28 -19
- package/dist/auth.d.ts +29 -20
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/index.rn.d.ts +3 -0
- package/dist/cordova/internal.js +7 -3
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-f608cd47.js → popup_redirect-c65b3459.js} +46 -26
- package/dist/cordova/popup_redirect-c65b3459.js.map +1 -0
- package/dist/cordova/src/core/errors.d.ts +2 -2
- package/dist/cordova/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/cordova/src/mfa/mfa_error.d.ts +4 -5
- package/dist/cordova/src/model/public_types.d.ts +25 -19
- package/dist/cordova/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/cordova/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/cordova/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/cordova/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/esm2017/{index-f41a0691.js → index-238d6fa9.js} +41 -24
- package/dist/esm2017/index-238d6fa9.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/index.rn.d.ts +3 -0
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/core/errors.d.ts +2 -2
- package/dist/esm2017/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/esm2017/src/mfa/mfa_error.d.ts +4 -5
- package/dist/esm2017/src/model/public_types.d.ts +25 -19
- package/dist/esm2017/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/esm2017/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/esm2017/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/esm2017/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/esm5/{index-fd8b7af5.js → index-47dd1018.js} +51 -27
- package/dist/esm5/index-47dd1018.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/index.rn.d.ts +3 -0
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/core/errors.d.ts +2 -2
- package/dist/esm5/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/esm5/src/mfa/mfa_error.d.ts +4 -5
- package/dist/esm5/src/model/public_types.d.ts +25 -19
- package/dist/esm5/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/esm5/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/esm5/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/esm5/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/index.rn.d.ts +3 -0
- package/dist/index.webworker.esm5.js +17 -16
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-358613ec.js → index-da4673cf.js} +18 -17
- package/dist/node/index-da4673cf.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.rn.d.ts +3 -0
- package/dist/node/internal.js +29 -10
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/core/errors.d.ts +2 -2
- package/dist/node/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/node/src/mfa/mfa_error.d.ts +4 -5
- package/dist/node/src/model/public_types.d.ts +25 -19
- package/dist/node/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/node/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/node/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/node/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/rn/index.js +70 -64
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/index.rn.d.ts +3 -0
- package/dist/rn/internal.js +338 -1465
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{enum_maps-81db3ff6.js → phone-e3d3bcce.js} +1187 -27
- package/dist/rn/phone-e3d3bcce.js.map +1 -0
- package/dist/rn/src/core/errors.d.ts +2 -2
- package/dist/rn/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/rn/src/mfa/mfa_error.d.ts +4 -5
- package/dist/rn/src/model/public_types.d.ts +25 -19
- package/dist/rn/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/rn/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/rn/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/rn/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/src/core/errors.d.ts +2 -2
- package/dist/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/src/mfa/mfa_error.d.ts +4 -5
- package/dist/src/model/public_types.d.ts +25 -19
- package/dist/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/package.json +2 -2
- package/dist/cordova/popup_redirect-f608cd47.js.map +0 -1
- package/dist/esm2017/index-f41a0691.js.map +0 -1
- package/dist/esm5/index-fd8b7af5.js.map +0 -1
- package/dist/node/index-358613ec.js.map +0 -1
- package/dist/rn/enum_maps-81db3ff6.js.map +0 -1
|
@@ -1858,7 +1858,7 @@ function _performSignInRequest(auth, method, path, request, customErrorMap) {
|
|
|
1858
1858
|
serverResponse = (_a.sent());
|
|
1859
1859
|
if ('mfaPendingCredential' in serverResponse) {
|
|
1860
1860
|
_fail(auth, "multi-factor-auth-required" /* MFA_REQUIRED */, {
|
|
1861
|
-
|
|
1861
|
+
_serverResponse: serverResponse
|
|
1862
1862
|
});
|
|
1863
1863
|
}
|
|
1864
1864
|
return [2 /*return*/, serverResponse];
|
|
@@ -5895,14 +5895,14 @@ var MultiFactorError = /** @class */ (function (_super) {
|
|
|
5895
5895
|
var _this = _super.call(this, error.code, error.message) || this;
|
|
5896
5896
|
_this.operationType = operationType;
|
|
5897
5897
|
_this.user = user;
|
|
5898
|
-
_this.name = 'FirebaseError';
|
|
5899
5898
|
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
5900
5899
|
Object.setPrototypeOf(_this, MultiFactorError.prototype);
|
|
5901
|
-
_this.
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5900
|
+
_this.customData = {
|
|
5901
|
+
appName: auth.name,
|
|
5902
|
+
tenantId: (_a = auth.tenantId) !== null && _a !== void 0 ? _a : undefined,
|
|
5903
|
+
_serverResponse: error.customData._serverResponse,
|
|
5904
|
+
operationType: operationType,
|
|
5905
|
+
};
|
|
5906
5906
|
return _this;
|
|
5907
5907
|
}
|
|
5908
5908
|
MultiFactorError._fromErrorAndOperation = function (auth, error, operationType, user) {
|
|
@@ -7440,11 +7440,12 @@ var MultiFactorResolverImpl = /** @class */ (function () {
|
|
|
7440
7440
|
MultiFactorResolverImpl._fromError = function (authExtern, error) {
|
|
7441
7441
|
var _this = this;
|
|
7442
7442
|
var auth = _castAuth(authExtern);
|
|
7443
|
-
var
|
|
7443
|
+
var serverResponse = error.customData._serverResponse;
|
|
7444
|
+
var hints = (serverResponse.mfaInfo || []).map(function (enrollment) {
|
|
7444
7445
|
return MultiFactorInfoImpl._fromServerResponse(auth, enrollment);
|
|
7445
7446
|
});
|
|
7446
|
-
_assert(
|
|
7447
|
-
var session = MultiFactorSessionImpl._fromMfaPendingCredential(
|
|
7447
|
+
_assert(serverResponse.mfaPendingCredential, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
7448
|
+
var session = MultiFactorSessionImpl._fromMfaPendingCredential(serverResponse.mfaPendingCredential);
|
|
7448
7449
|
return new MultiFactorResolverImpl(session, hints, function (assertion) { return __awaiter(_this, void 0, void 0, function () {
|
|
7449
7450
|
var mfaResponse, idTokenResponse, _a, userCredential;
|
|
7450
7451
|
return __generator(this, function (_b) {
|
|
@@ -7453,9 +7454,9 @@ var MultiFactorResolverImpl = /** @class */ (function () {
|
|
|
7453
7454
|
case 1:
|
|
7454
7455
|
mfaResponse = _b.sent();
|
|
7455
7456
|
// Clear out the unneeded fields from the old login response
|
|
7456
|
-
delete
|
|
7457
|
-
delete
|
|
7458
|
-
idTokenResponse = __assign(__assign({},
|
|
7457
|
+
delete serverResponse.mfaInfo;
|
|
7458
|
+
delete serverResponse.mfaPendingCredential;
|
|
7459
|
+
idTokenResponse = __assign(__assign({}, serverResponse), { idToken: mfaResponse.idToken, refreshToken: mfaResponse.refreshToken });
|
|
7459
7460
|
_a = error.operationType;
|
|
7460
7461
|
switch (_a) {
|
|
7461
7462
|
case "signIn" /* SIGN_IN */: return [3 /*break*/, 2];
|
|
@@ -7505,8 +7506,8 @@ function getMultiFactorResolver(auth, error) {
|
|
|
7505
7506
|
var _a;
|
|
7506
7507
|
var authModular = getModularInstance(auth);
|
|
7507
7508
|
var errorInternal = error;
|
|
7508
|
-
_assert(error.operationType, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
7509
|
-
_assert((_a = errorInternal.
|
|
7509
|
+
_assert(error.customData.operationType, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
7510
|
+
_assert((_a = errorInternal.customData._serverResponse) === null || _a === void 0 ? void 0 : _a.mfaPendingCredential, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
7510
7511
|
return MultiFactorResolverImpl._fromError(authModular, errorInternal);
|
|
7511
7512
|
}
|
|
7512
7513
|
|
|
@@ -7665,7 +7666,7 @@ function multiFactor(user) {
|
|
|
7665
7666
|
}
|
|
7666
7667
|
|
|
7667
7668
|
var name = "@firebase/auth";
|
|
7668
|
-
var version = "0.
|
|
7669
|
+
var version = "0.19.0";
|
|
7669
7670
|
|
|
7670
7671
|
/**
|
|
7671
7672
|
* @license
|
|
@@ -7946,8 +7947,8 @@ var ActionCodeOperation = {
|
|
|
7946
7947
|
// Both have the same implementation but use a different underlying storage
|
|
7947
7948
|
// object.
|
|
7948
7949
|
var BrowserPersistenceClass = /** @class */ (function () {
|
|
7949
|
-
function BrowserPersistenceClass(
|
|
7950
|
-
this.
|
|
7950
|
+
function BrowserPersistenceClass(storageRetriever, type) {
|
|
7951
|
+
this.storageRetriever = storageRetriever;
|
|
7951
7952
|
this.type = type;
|
|
7952
7953
|
}
|
|
7953
7954
|
BrowserPersistenceClass.prototype._isAvailable = function () {
|
|
@@ -7975,6 +7976,13 @@ var BrowserPersistenceClass = /** @class */ (function () {
|
|
|
7975
7976
|
this.storage.removeItem(key);
|
|
7976
7977
|
return Promise.resolve();
|
|
7977
7978
|
};
|
|
7979
|
+
Object.defineProperty(BrowserPersistenceClass.prototype, "storage", {
|
|
7980
|
+
get: function () {
|
|
7981
|
+
return this.storageRetriever();
|
|
7982
|
+
},
|
|
7983
|
+
enumerable: false,
|
|
7984
|
+
configurable: true
|
|
7985
|
+
});
|
|
7978
7986
|
return BrowserPersistenceClass;
|
|
7979
7987
|
}());
|
|
7980
7988
|
|
|
@@ -8005,7 +8013,7 @@ var IE10_LOCAL_STORAGE_SYNC_DELAY = 10;
|
|
|
8005
8013
|
var BrowserLocalPersistence = /** @class */ (function (_super) {
|
|
8006
8014
|
__extends(BrowserLocalPersistence, _super);
|
|
8007
8015
|
function BrowserLocalPersistence() {
|
|
8008
|
-
var _this = _super.call(this, window.localStorage, "LOCAL" /* LOCAL */) || this;
|
|
8016
|
+
var _this = _super.call(this, function () { return window.localStorage; }, "LOCAL" /* LOCAL */) || this;
|
|
8009
8017
|
_this.boundEventHandler = function (event, poll) { return _this.onStorageEvent(event, poll); };
|
|
8010
8018
|
_this.listeners = {};
|
|
8011
8019
|
_this.localCache = {};
|
|
@@ -8241,7 +8249,7 @@ var browserLocalPersistence = BrowserLocalPersistence;
|
|
|
8241
8249
|
var BrowserSessionPersistence = /** @class */ (function (_super) {
|
|
8242
8250
|
__extends(BrowserSessionPersistence, _super);
|
|
8243
8251
|
function BrowserSessionPersistence() {
|
|
8244
|
-
return _super.call(this, window.sessionStorage, "SESSION" /* SESSION */) || this;
|
|
8252
|
+
return _super.call(this, function () { return window.sessionStorage; }, "SESSION" /* SESSION */) || this;
|
|
8245
8253
|
}
|
|
8246
8254
|
BrowserSessionPersistence.prototype._addListener = function (_key, _listener) {
|
|
8247
8255
|
// Listeners are not supported for session storage since it cannot be shared across windows
|
|
@@ -8564,7 +8572,13 @@ var RedirectAction = /** @class */ (function (_super) {
|
|
|
8564
8572
|
case 7:
|
|
8565
8573
|
redirectOutcomeMap.set(this.auth._key(), readyOutcome);
|
|
8566
8574
|
_b.label = 8;
|
|
8567
|
-
case 8:
|
|
8575
|
+
case 8:
|
|
8576
|
+
// If we're not bypassing auth state, the ready outcome should be set to
|
|
8577
|
+
// null.
|
|
8578
|
+
if (!this.bypassAuthState) {
|
|
8579
|
+
redirectOutcomeMap.set(this.auth._key(), function () { return Promise.resolve(null); });
|
|
8580
|
+
}
|
|
8581
|
+
return [2 /*return*/, readyOutcome()];
|
|
8568
8582
|
}
|
|
8569
8583
|
});
|
|
8570
8584
|
});
|
|
@@ -8610,16 +8624,22 @@ var RedirectAction = /** @class */ (function (_super) {
|
|
|
8610
8624
|
}(AbstractPopupRedirectOperation));
|
|
8611
8625
|
function _getAndClearPendingRedirectStatus(resolver, auth) {
|
|
8612
8626
|
return __awaiter(this, void 0, void 0, function () {
|
|
8613
|
-
var key, hasPendingRedirect;
|
|
8627
|
+
var key, persistence, hasPendingRedirect;
|
|
8614
8628
|
return __generator(this, function (_a) {
|
|
8615
8629
|
switch (_a.label) {
|
|
8616
8630
|
case 0:
|
|
8617
8631
|
key = pendingRedirectKey(auth);
|
|
8618
|
-
|
|
8632
|
+
persistence = resolverPersistence(resolver);
|
|
8633
|
+
return [4 /*yield*/, persistence._isAvailable()];
|
|
8619
8634
|
case 1:
|
|
8620
|
-
|
|
8621
|
-
|
|
8635
|
+
if (!(_a.sent())) {
|
|
8636
|
+
return [2 /*return*/, false];
|
|
8637
|
+
}
|
|
8638
|
+
return [4 /*yield*/, persistence._get(key)];
|
|
8622
8639
|
case 2:
|
|
8640
|
+
hasPendingRedirect = (_a.sent()) === 'true';
|
|
8641
|
+
return [4 /*yield*/, persistence._remove(key)];
|
|
8642
|
+
case 3:
|
|
8623
8643
|
_a.sent();
|
|
8624
8644
|
return [2 /*return*/, hasPendingRedirect];
|
|
8625
8645
|
}
|
|
@@ -9788,4 +9808,4 @@ function generateNoEvent() {
|
|
|
9788
9808
|
}
|
|
9789
9809
|
|
|
9790
9810
|
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 };
|
|
9791
|
-
//# sourceMappingURL=popup_redirect-
|
|
9811
|
+
//# sourceMappingURL=popup_redirect-c65b3459.js.map
|