@firebase/auth 0.20.7 → 0.20.8-canary.03d1fabcb
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/auth-public.d.ts +1 -2
- package/dist/auth.d.ts +1 -2
- 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-b64a377b.js} +3 -4
- package/dist/cordova/{popup_redirect-d3ceb9fa.js.map → popup_redirect-b64a377b.js.map} +1 -1
- package/dist/cordova/src/platform_browser/strategies/redirect.d.ts +1 -2
- package/dist/esm2017/{index-4dc22a28.js → index-d3d3ceaa.js} +42 -7
- package/dist/esm2017/{index-4dc22a28.js.map → index-d3d3ceaa.js.map} +1 -1
- package/dist/esm2017/index.js +2 -2
- package/dist/esm2017/internal.js +3 -3
- package/dist/esm2017/src/platform_browser/strategies/redirect.d.ts +1 -2
- package/dist/esm5/{index-e8139339.js → index-eefdd302.js} +58 -6
- package/dist/esm5/{index-e8139339.js.map → index-eefdd302.js.map} +1 -1
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/platform_browser/strategies/redirect.d.ts +1 -2
- package/dist/index.webworker.esm5.js +1 -1
- package/dist/node/{index-fe75eadf.js → index-fb4fdeac.js} +8 -3
- package/dist/node/{index-fe75eadf.js.map → index-fb4fdeac.js.map} +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/platform_browser/strategies/redirect.d.ts +1 -2
- package/dist/node-esm/{index-2a56c39c.js → index-30edc59f.js} +9 -4
- package/dist/node-esm/{index-2a56c39c.js.map → index-30edc59f.js.map} +1 -1
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/node-esm/src/platform_browser/strategies/redirect.d.ts +1 -2
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +56 -4
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-bf6b4ef6.js → phone-d260eee1.js} +2 -2
- package/dist/rn/{phone-bf6b4ef6.js.map → phone-d260eee1.js.map} +1 -1
- package/dist/rn/src/platform_browser/strategies/redirect.d.ts +1 -2
- package/dist/src/platform_browser/strategies/redirect.d.ts +1 -2
- package/package.json +6 -6
|
@@ -118,8 +118,7 @@ export declare function _linkWithRedirect(user: User, provider: AuthProvider, re
|
|
|
118
118
|
*
|
|
119
119
|
* @remarks
|
|
120
120
|
* If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an
|
|
121
|
-
* error. If no redirect operation was called, returns
|
|
122
|
-
* with a null `user`.
|
|
121
|
+
* error. If no redirect operation was called, returns `null`.
|
|
123
122
|
*
|
|
124
123
|
* @example
|
|
125
124
|
* ```javascript
|
|
@@ -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
|
/**
|
|
@@ -8496,8 +8496,7 @@ async function _linkWithRedirect(user, provider, resolver) {
|
|
|
8496
8496
|
*
|
|
8497
8497
|
* @remarks
|
|
8498
8498
|
* If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an
|
|
8499
|
-
* error. If no redirect operation was called, returns
|
|
8500
|
-
* with a null `user`.
|
|
8499
|
+
* error. If no redirect operation was called, returns `null`.
|
|
8501
8500
|
*
|
|
8502
8501
|
* @example
|
|
8503
8502
|
* ```javascript
|
|
@@ -9296,7 +9295,7 @@ class PhoneMultiFactorGenerator {
|
|
|
9296
9295
|
PhoneMultiFactorGenerator.FACTOR_ID = 'phone';
|
|
9297
9296
|
|
|
9298
9297
|
var name = "@firebase/auth";
|
|
9299
|
-
var version = "0.20.
|
|
9298
|
+
var version = "0.20.8-canary.03d1fabcb";
|
|
9300
9299
|
|
|
9301
9300
|
/**
|
|
9302
9301
|
* @license
|
|
@@ -9462,6 +9461,31 @@ function registerAuth(clientPlatform) {
|
|
|
9462
9461
|
* See the License for the specific language governing permissions and
|
|
9463
9462
|
* limitations under the License.
|
|
9464
9463
|
*/
|
|
9464
|
+
const DEFAULT_ID_TOKEN_MAX_AGE = 5 * 60;
|
|
9465
|
+
const authIdTokenMaxAge = getExperimentalSetting('authIdTokenMaxAge') || DEFAULT_ID_TOKEN_MAX_AGE;
|
|
9466
|
+
let lastPostedIdToken = null;
|
|
9467
|
+
const mintCookieFactory = (url) => async (user) => {
|
|
9468
|
+
const idTokenResult = user && (await user.getIdTokenResult());
|
|
9469
|
+
const idTokenAge = idTokenResult &&
|
|
9470
|
+
(new Date().getTime() - Date.parse(idTokenResult.issuedAtTime)) / 1000;
|
|
9471
|
+
if (idTokenAge && idTokenAge > authIdTokenMaxAge) {
|
|
9472
|
+
return;
|
|
9473
|
+
}
|
|
9474
|
+
// Specifically trip null => undefined when logged out, to delete any existing cookie
|
|
9475
|
+
const idToken = idTokenResult === null || idTokenResult === void 0 ? void 0 : idTokenResult.token;
|
|
9476
|
+
if (lastPostedIdToken === idToken) {
|
|
9477
|
+
return;
|
|
9478
|
+
}
|
|
9479
|
+
lastPostedIdToken = idToken;
|
|
9480
|
+
await fetch(url, {
|
|
9481
|
+
method: idToken ? 'POST' : 'DELETE',
|
|
9482
|
+
headers: idToken
|
|
9483
|
+
? {
|
|
9484
|
+
'Authorization': `Bearer ${idToken}`
|
|
9485
|
+
}
|
|
9486
|
+
: {}
|
|
9487
|
+
});
|
|
9488
|
+
};
|
|
9465
9489
|
/**
|
|
9466
9490
|
* Returns the Auth instance associated with the provided {@link @firebase/app#FirebaseApp}.
|
|
9467
9491
|
* If no instance exists, initializes an Auth instance with platform-specific default dependencies.
|
|
@@ -9475,7 +9499,7 @@ function getAuth(app = getApp()) {
|
|
|
9475
9499
|
if (provider.isInitialized()) {
|
|
9476
9500
|
return provider.getImmediate();
|
|
9477
9501
|
}
|
|
9478
|
-
|
|
9502
|
+
const auth = initializeAuth(app, {
|
|
9479
9503
|
popupRedirectResolver: browserPopupRedirectResolver,
|
|
9480
9504
|
persistence: [
|
|
9481
9505
|
indexedDBLocalPersistence,
|
|
@@ -9483,8 +9507,19 @@ function getAuth(app = getApp()) {
|
|
|
9483
9507
|
browserSessionPersistence
|
|
9484
9508
|
]
|
|
9485
9509
|
});
|
|
9510
|
+
const authTokenSyncUrl = getExperimentalSetting('authTokenSyncURL');
|
|
9511
|
+
if (authTokenSyncUrl) {
|
|
9512
|
+
const mintCookie = mintCookieFactory(authTokenSyncUrl);
|
|
9513
|
+
beforeAuthStateChanged(auth, mintCookie, () => mintCookie(auth.currentUser));
|
|
9514
|
+
onIdTokenChanged(auth, user => mintCookie(user));
|
|
9515
|
+
}
|
|
9516
|
+
const authEmulatorHost = getDefaultEmulatorHost('auth');
|
|
9517
|
+
if (authEmulatorHost) {
|
|
9518
|
+
connectAuthEmulator(auth, `http://${authEmulatorHost}`);
|
|
9519
|
+
}
|
|
9520
|
+
return auth;
|
|
9486
9521
|
}
|
|
9487
9522
|
registerAuth("Browser" /* BROWSER */);
|
|
9488
9523
|
|
|
9489
9524
|
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-
|
|
9525
|
+
//# sourceMappingURL=index-d3d3ceaa.js.map
|