@firebase/auth 0.20.7 → 0.20.8-canary.9799efe9d
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 +10 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +57 -4
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-d3ceb9fa.js → popup_redirect-6fdcf7be.js} +2 -2
- package/dist/cordova/{popup_redirect-d3ceb9fa.js.map → popup_redirect-6fdcf7be.js.map} +1 -1
- package/dist/esm2017/{index-4dc22a28.js → index-0a6746f3.js} +41 -5
- package/dist/esm2017/{index-4dc22a28.js.map → index-0a6746f3.js.map} +1 -1
- package/dist/esm2017/index.js +2 -2
- package/dist/esm2017/internal.js +3 -3
- package/dist/esm5/{index-e8139339.js → index-615dcffe.js} +57 -4
- package/dist/esm5/{index-e8139339.js.map → index-615dcffe.js.map} +1 -1
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/index.webworker.esm5.js +1 -1
- package/dist/node/{index-fe75eadf.js → index-25bbe4e1.js} +8 -3
- package/dist/node/{index-fe75eadf.js.map → index-25bbe4e1.js.map} +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node-esm/{index-2a56c39c.js → index-eddbee39.js} +9 -4
- package/dist/node-esm/{index-2a56c39c.js.map → index-eddbee39.js.map} +1 -1
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +2 -2
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +55 -2
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-bf6b4ef6.js → phone-747adb52.js} +2 -2
- package/dist/rn/{phone-bf6b4ef6.js.map → phone-747adb52.js.map} +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ErrorFactory, deepEqual, isBrowserExtension, isMobileCordova, isReactNative, FirebaseError, querystring, getModularInstance, base64Decode, getUA, isIE, createSubscribe, querystringDecode, extractQuerystring, isEmpty } from '@firebase/util';
|
|
1
|
+
import { ErrorFactory, deepEqual, isBrowserExtension, isMobileCordova, isReactNative, FirebaseError, querystring, getModularInstance, base64Decode, getUA, isIE, createSubscribe, querystringDecode, extractQuerystring, isEmpty, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
|
|
2
2
|
import { SDK_VERSION, _getProvider, _registerComponent, registerVersion, getApp } from '@firebase/app';
|
|
3
|
-
import { __rest } from 'tslib';
|
|
4
3
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
4
|
+
import { __rest } from 'tslib';
|
|
5
5
|
import { Component } from '@firebase/component';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -9296,7 +9296,7 @@ class PhoneMultiFactorGenerator {
|
|
|
9296
9296
|
PhoneMultiFactorGenerator.FACTOR_ID = 'phone';
|
|
9297
9297
|
|
|
9298
9298
|
var name = "@firebase/auth";
|
|
9299
|
-
var version = "0.20.
|
|
9299
|
+
var version = "0.20.8-canary.9799efe9d";
|
|
9300
9300
|
|
|
9301
9301
|
/**
|
|
9302
9302
|
* @license
|
|
@@ -9462,6 +9462,31 @@ function registerAuth(clientPlatform) {
|
|
|
9462
9462
|
* See the License for the specific language governing permissions and
|
|
9463
9463
|
* limitations under the License.
|
|
9464
9464
|
*/
|
|
9465
|
+
const DEFAULT_ID_TOKEN_MAX_AGE = 5 * 60;
|
|
9466
|
+
const authIdTokenMaxAge = getExperimentalSetting('authIdTokenMaxAge') || DEFAULT_ID_TOKEN_MAX_AGE;
|
|
9467
|
+
let lastPostedIdToken = null;
|
|
9468
|
+
const mintCookieFactory = (url) => async (user) => {
|
|
9469
|
+
const idTokenResult = user && (await user.getIdTokenResult());
|
|
9470
|
+
const idTokenAge = idTokenResult &&
|
|
9471
|
+
(new Date().getTime() - Date.parse(idTokenResult.issuedAtTime)) / 1000;
|
|
9472
|
+
if (idTokenAge && idTokenAge > authIdTokenMaxAge) {
|
|
9473
|
+
return;
|
|
9474
|
+
}
|
|
9475
|
+
// Specifically trip null => undefined when logged out, to delete any existing cookie
|
|
9476
|
+
const idToken = idTokenResult === null || idTokenResult === void 0 ? void 0 : idTokenResult.token;
|
|
9477
|
+
if (lastPostedIdToken === idToken) {
|
|
9478
|
+
return;
|
|
9479
|
+
}
|
|
9480
|
+
lastPostedIdToken = idToken;
|
|
9481
|
+
await fetch(url, {
|
|
9482
|
+
method: idToken ? 'POST' : 'DELETE',
|
|
9483
|
+
headers: idToken
|
|
9484
|
+
? {
|
|
9485
|
+
'Authorization': `Bearer ${idToken}`
|
|
9486
|
+
}
|
|
9487
|
+
: {}
|
|
9488
|
+
});
|
|
9489
|
+
};
|
|
9465
9490
|
/**
|
|
9466
9491
|
* Returns the Auth instance associated with the provided {@link @firebase/app#FirebaseApp}.
|
|
9467
9492
|
* If no instance exists, initializes an Auth instance with platform-specific default dependencies.
|
|
@@ -9475,7 +9500,7 @@ function getAuth(app = getApp()) {
|
|
|
9475
9500
|
if (provider.isInitialized()) {
|
|
9476
9501
|
return provider.getImmediate();
|
|
9477
9502
|
}
|
|
9478
|
-
|
|
9503
|
+
const auth = initializeAuth(app, {
|
|
9479
9504
|
popupRedirectResolver: browserPopupRedirectResolver,
|
|
9480
9505
|
persistence: [
|
|
9481
9506
|
indexedDBLocalPersistence,
|
|
@@ -9483,8 +9508,19 @@ function getAuth(app = getApp()) {
|
|
|
9483
9508
|
browserSessionPersistence
|
|
9484
9509
|
]
|
|
9485
9510
|
});
|
|
9511
|
+
const authTokenSyncUrl = getExperimentalSetting('authTokenSyncURL');
|
|
9512
|
+
if (authTokenSyncUrl) {
|
|
9513
|
+
const mintCookie = mintCookieFactory(authTokenSyncUrl);
|
|
9514
|
+
beforeAuthStateChanged(auth, mintCookie, () => mintCookie(auth.currentUser));
|
|
9515
|
+
onIdTokenChanged(auth, user => mintCookie(user));
|
|
9516
|
+
}
|
|
9517
|
+
const authEmulatorHost = getDefaultEmulatorHost('auth');
|
|
9518
|
+
if (authEmulatorHost) {
|
|
9519
|
+
connectAuthEmulator(auth, `http://${authEmulatorHost}`);
|
|
9520
|
+
}
|
|
9521
|
+
return auth;
|
|
9486
9522
|
}
|
|
9487
9523
|
registerAuth("Browser" /* BROWSER */);
|
|
9488
9524
|
|
|
9489
9525
|
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 };
|
|
9490
|
-
//# sourceMappingURL=index-
|
|
9526
|
+
//# sourceMappingURL=index-0a6746f3.js.map
|