@firebase/auth 0.18.3 → 0.19.0-canary.477bdef13
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-d7b9a2c0.js} +54 -33
- package/dist/cordova/popup_redirect-d7b9a2c0.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-030cefd0.js} +43 -25
- package/dist/esm2017/index-030cefd0.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-5050030d.js} +59 -34
- package/dist/esm5/index-5050030d.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 +25 -23
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-358613ec.js → index-99e8c13b.js} +26 -24
- package/dist/node/index-99e8c13b.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-c7fcf861.js} +1195 -34
- package/dist/rn/phone-c7fcf861.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 +6 -6
- 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];
|
|
@@ -3321,9 +3321,9 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3321
3321
|
// promise resolution)
|
|
3322
3322
|
this._initializationPromise = this.queue(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3323
3323
|
var _a;
|
|
3324
|
-
var _b;
|
|
3325
|
-
return __generator(this, function (
|
|
3326
|
-
switch (
|
|
3324
|
+
var _b, _c;
|
|
3325
|
+
return __generator(this, function (_d) {
|
|
3326
|
+
switch (_d.label) {
|
|
3327
3327
|
case 0:
|
|
3328
3328
|
if (this._deleted) {
|
|
3329
3329
|
return [2 /*return*/];
|
|
@@ -3331,18 +3331,19 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3331
3331
|
_a = this;
|
|
3332
3332
|
return [4 /*yield*/, PersistenceUserManager.create(this, persistenceHierarchy)];
|
|
3333
3333
|
case 1:
|
|
3334
|
-
_a.persistenceManager =
|
|
3334
|
+
_a.persistenceManager = _d.sent();
|
|
3335
3335
|
if (this._deleted) {
|
|
3336
3336
|
return [2 /*return*/];
|
|
3337
3337
|
}
|
|
3338
3338
|
if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/, 3];
|
|
3339
3339
|
return [4 /*yield*/, this._popupRedirectResolver._initialize(this)];
|
|
3340
3340
|
case 2:
|
|
3341
|
-
|
|
3342
|
-
|
|
3341
|
+
_d.sent();
|
|
3342
|
+
_d.label = 3;
|
|
3343
3343
|
case 3: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
|
|
3344
3344
|
case 4:
|
|
3345
|
-
|
|
3345
|
+
_d.sent();
|
|
3346
|
+
this.lastNotifiedUid = ((_c = this.currentUser) === null || _c === void 0 ? void 0 : _c.uid) || null;
|
|
3346
3347
|
if (this._deleted) {
|
|
3347
3348
|
return [2 /*return*/];
|
|
3348
3349
|
}
|
|
@@ -5895,14 +5896,14 @@ var MultiFactorError = /** @class */ (function (_super) {
|
|
|
5895
5896
|
var _this = _super.call(this, error.code, error.message) || this;
|
|
5896
5897
|
_this.operationType = operationType;
|
|
5897
5898
|
_this.user = user;
|
|
5898
|
-
_this.name = 'FirebaseError';
|
|
5899
5899
|
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
5900
5900
|
Object.setPrototypeOf(_this, MultiFactorError.prototype);
|
|
5901
|
-
_this.
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5901
|
+
_this.customData = {
|
|
5902
|
+
appName: auth.name,
|
|
5903
|
+
tenantId: (_a = auth.tenantId) !== null && _a !== void 0 ? _a : undefined,
|
|
5904
|
+
_serverResponse: error.customData._serverResponse,
|
|
5905
|
+
operationType: operationType,
|
|
5906
|
+
};
|
|
5906
5907
|
return _this;
|
|
5907
5908
|
}
|
|
5908
5909
|
MultiFactorError._fromErrorAndOperation = function (auth, error, operationType, user) {
|
|
@@ -7440,11 +7441,12 @@ var MultiFactorResolverImpl = /** @class */ (function () {
|
|
|
7440
7441
|
MultiFactorResolverImpl._fromError = function (authExtern, error) {
|
|
7441
7442
|
var _this = this;
|
|
7442
7443
|
var auth = _castAuth(authExtern);
|
|
7443
|
-
var
|
|
7444
|
+
var serverResponse = error.customData._serverResponse;
|
|
7445
|
+
var hints = (serverResponse.mfaInfo || []).map(function (enrollment) {
|
|
7444
7446
|
return MultiFactorInfoImpl._fromServerResponse(auth, enrollment);
|
|
7445
7447
|
});
|
|
7446
|
-
_assert(
|
|
7447
|
-
var session = MultiFactorSessionImpl._fromMfaPendingCredential(
|
|
7448
|
+
_assert(serverResponse.mfaPendingCredential, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
7449
|
+
var session = MultiFactorSessionImpl._fromMfaPendingCredential(serverResponse.mfaPendingCredential);
|
|
7448
7450
|
return new MultiFactorResolverImpl(session, hints, function (assertion) { return __awaiter(_this, void 0, void 0, function () {
|
|
7449
7451
|
var mfaResponse, idTokenResponse, _a, userCredential;
|
|
7450
7452
|
return __generator(this, function (_b) {
|
|
@@ -7453,9 +7455,9 @@ var MultiFactorResolverImpl = /** @class */ (function () {
|
|
|
7453
7455
|
case 1:
|
|
7454
7456
|
mfaResponse = _b.sent();
|
|
7455
7457
|
// Clear out the unneeded fields from the old login response
|
|
7456
|
-
delete
|
|
7457
|
-
delete
|
|
7458
|
-
idTokenResponse = __assign(__assign({},
|
|
7458
|
+
delete serverResponse.mfaInfo;
|
|
7459
|
+
delete serverResponse.mfaPendingCredential;
|
|
7460
|
+
idTokenResponse = __assign(__assign({}, serverResponse), { idToken: mfaResponse.idToken, refreshToken: mfaResponse.refreshToken });
|
|
7459
7461
|
_a = error.operationType;
|
|
7460
7462
|
switch (_a) {
|
|
7461
7463
|
case "signIn" /* SIGN_IN */: return [3 /*break*/, 2];
|
|
@@ -7505,8 +7507,8 @@ function getMultiFactorResolver(auth, error) {
|
|
|
7505
7507
|
var _a;
|
|
7506
7508
|
var authModular = getModularInstance(auth);
|
|
7507
7509
|
var errorInternal = error;
|
|
7508
|
-
_assert(error.operationType, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
7509
|
-
_assert((_a = errorInternal.
|
|
7510
|
+
_assert(error.customData.operationType, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
7511
|
+
_assert((_a = errorInternal.customData._serverResponse) === null || _a === void 0 ? void 0 : _a.mfaPendingCredential, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
7510
7512
|
return MultiFactorResolverImpl._fromError(authModular, errorInternal);
|
|
7511
7513
|
}
|
|
7512
7514
|
|
|
@@ -7665,7 +7667,7 @@ function multiFactor(user) {
|
|
|
7665
7667
|
}
|
|
7666
7668
|
|
|
7667
7669
|
var name = "@firebase/auth";
|
|
7668
|
-
var version = "0.
|
|
7670
|
+
var version = "0.19.0-canary.477bdef13";
|
|
7669
7671
|
|
|
7670
7672
|
/**
|
|
7671
7673
|
* @license
|
|
@@ -7946,8 +7948,8 @@ var ActionCodeOperation = {
|
|
|
7946
7948
|
// Both have the same implementation but use a different underlying storage
|
|
7947
7949
|
// object.
|
|
7948
7950
|
var BrowserPersistenceClass = /** @class */ (function () {
|
|
7949
|
-
function BrowserPersistenceClass(
|
|
7950
|
-
this.
|
|
7951
|
+
function BrowserPersistenceClass(storageRetriever, type) {
|
|
7952
|
+
this.storageRetriever = storageRetriever;
|
|
7951
7953
|
this.type = type;
|
|
7952
7954
|
}
|
|
7953
7955
|
BrowserPersistenceClass.prototype._isAvailable = function () {
|
|
@@ -7975,6 +7977,13 @@ var BrowserPersistenceClass = /** @class */ (function () {
|
|
|
7975
7977
|
this.storage.removeItem(key);
|
|
7976
7978
|
return Promise.resolve();
|
|
7977
7979
|
};
|
|
7980
|
+
Object.defineProperty(BrowserPersistenceClass.prototype, "storage", {
|
|
7981
|
+
get: function () {
|
|
7982
|
+
return this.storageRetriever();
|
|
7983
|
+
},
|
|
7984
|
+
enumerable: false,
|
|
7985
|
+
configurable: true
|
|
7986
|
+
});
|
|
7978
7987
|
return BrowserPersistenceClass;
|
|
7979
7988
|
}());
|
|
7980
7989
|
|
|
@@ -8005,7 +8014,7 @@ var IE10_LOCAL_STORAGE_SYNC_DELAY = 10;
|
|
|
8005
8014
|
var BrowserLocalPersistence = /** @class */ (function (_super) {
|
|
8006
8015
|
__extends(BrowserLocalPersistence, _super);
|
|
8007
8016
|
function BrowserLocalPersistence() {
|
|
8008
|
-
var _this = _super.call(this, window.localStorage, "LOCAL" /* LOCAL */) || this;
|
|
8017
|
+
var _this = _super.call(this, function () { return window.localStorage; }, "LOCAL" /* LOCAL */) || this;
|
|
8009
8018
|
_this.boundEventHandler = function (event, poll) { return _this.onStorageEvent(event, poll); };
|
|
8010
8019
|
_this.listeners = {};
|
|
8011
8020
|
_this.localCache = {};
|
|
@@ -8241,7 +8250,7 @@ var browserLocalPersistence = BrowserLocalPersistence;
|
|
|
8241
8250
|
var BrowserSessionPersistence = /** @class */ (function (_super) {
|
|
8242
8251
|
__extends(BrowserSessionPersistence, _super);
|
|
8243
8252
|
function BrowserSessionPersistence() {
|
|
8244
|
-
return _super.call(this, window.sessionStorage, "SESSION" /* SESSION */) || this;
|
|
8253
|
+
return _super.call(this, function () { return window.sessionStorage; }, "SESSION" /* SESSION */) || this;
|
|
8245
8254
|
}
|
|
8246
8255
|
BrowserSessionPersistence.prototype._addListener = function (_key, _listener) {
|
|
8247
8256
|
// Listeners are not supported for session storage since it cannot be shared across windows
|
|
@@ -8564,7 +8573,13 @@ var RedirectAction = /** @class */ (function (_super) {
|
|
|
8564
8573
|
case 7:
|
|
8565
8574
|
redirectOutcomeMap.set(this.auth._key(), readyOutcome);
|
|
8566
8575
|
_b.label = 8;
|
|
8567
|
-
case 8:
|
|
8576
|
+
case 8:
|
|
8577
|
+
// If we're not bypassing auth state, the ready outcome should be set to
|
|
8578
|
+
// null.
|
|
8579
|
+
if (!this.bypassAuthState) {
|
|
8580
|
+
redirectOutcomeMap.set(this.auth._key(), function () { return Promise.resolve(null); });
|
|
8581
|
+
}
|
|
8582
|
+
return [2 /*return*/, readyOutcome()];
|
|
8568
8583
|
}
|
|
8569
8584
|
});
|
|
8570
8585
|
});
|
|
@@ -8610,16 +8625,22 @@ var RedirectAction = /** @class */ (function (_super) {
|
|
|
8610
8625
|
}(AbstractPopupRedirectOperation));
|
|
8611
8626
|
function _getAndClearPendingRedirectStatus(resolver, auth) {
|
|
8612
8627
|
return __awaiter(this, void 0, void 0, function () {
|
|
8613
|
-
var key, hasPendingRedirect;
|
|
8628
|
+
var key, persistence, hasPendingRedirect;
|
|
8614
8629
|
return __generator(this, function (_a) {
|
|
8615
8630
|
switch (_a.label) {
|
|
8616
8631
|
case 0:
|
|
8617
8632
|
key = pendingRedirectKey(auth);
|
|
8618
|
-
|
|
8633
|
+
persistence = resolverPersistence(resolver);
|
|
8634
|
+
return [4 /*yield*/, persistence._isAvailable()];
|
|
8619
8635
|
case 1:
|
|
8620
|
-
|
|
8621
|
-
|
|
8636
|
+
if (!(_a.sent())) {
|
|
8637
|
+
return [2 /*return*/, false];
|
|
8638
|
+
}
|
|
8639
|
+
return [4 /*yield*/, persistence._get(key)];
|
|
8622
8640
|
case 2:
|
|
8641
|
+
hasPendingRedirect = (_a.sent()) === 'true';
|
|
8642
|
+
return [4 /*yield*/, persistence._remove(key)];
|
|
8643
|
+
case 3:
|
|
8623
8644
|
_a.sent();
|
|
8624
8645
|
return [2 /*return*/, hasPendingRedirect];
|
|
8625
8646
|
}
|
|
@@ -9788,4 +9809,4 @@ function generateNoEvent() {
|
|
|
9788
9809
|
}
|
|
9789
9810
|
|
|
9790
9811
|
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-
|
|
9812
|
+
//# sourceMappingURL=popup_redirect-d7b9a2c0.js.map
|