@firebase/auth 1.13.9 → 1.13.10-20261111165442
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/dist/auth-public.d.ts +1 -0
- package/dist/auth.d.ts +1 -0
- package/dist/browser-cjs/{index-DTUcAMkM.js → index-3quNI-5T.js} +180 -62
- package/dist/browser-cjs/index-3quNI-5T.js.map +1 -0
- package/dist/browser-cjs/index.js +1 -1
- package/dist/browser-cjs/internal.js +1 -1
- package/dist/browser-cjs/src/core/persistence/index.d.ts +1 -0
- package/dist/browser-cjs/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/dist/cordova/auth-cordova-public.d.ts +1 -0
- package/dist/cordova/auth-cordova.d.ts +1 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +2 -2
- package/dist/cordova/{popup_redirect-xyFFcAgj.js → popup_redirect-BfyV9XtN.js} +180 -62
- package/dist/cordova/popup_redirect-BfyV9XtN.js.map +1 -0
- package/dist/cordova/src/core/persistence/index.d.ts +1 -0
- package/dist/cordova/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/dist/esm/{index-Bz2J43nW.js → index-D7PwIQ8t.js} +180 -62
- package/dist/esm/index-D7PwIQ8t.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal.js +2 -2
- package/dist/esm/src/core/persistence/index.d.ts +1 -0
- package/dist/esm/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/dist/index.webworker.js +179 -61
- package/dist/index.webworker.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/core/persistence/index.d.ts +1 -0
- package/dist/node/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/dist/node/{totp-CMTC0AYP.js → totp-Cvunw6R9.js} +49 -30
- package/dist/node/totp-Cvunw6R9.js.map +1 -0
- 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/core/persistence/index.d.ts +1 -0
- package/dist/node-esm/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/dist/node-esm/{totp-pe8Y0u5S.js → totp-BIzof36h.js} +49 -30
- package/dist/node-esm/totp-BIzof36h.js.map +1 -0
- package/dist/rn/{index-DzY9h3Kn.js → index-Cjrvemz_.js} +49 -30
- package/dist/rn/index-Cjrvemz_.js.map +1 -0
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +132 -33
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/src/core/persistence/index.d.ts +1 -0
- package/dist/rn/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/dist/src/core/persistence/index.d.ts +1 -0
- package/dist/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/dist/web-extension-cjs/index.js +1 -1
- package/dist/web-extension-cjs/internal.js +1 -1
- package/dist/web-extension-cjs/{register-CTiLN4Sf.js → register-Bj5RraXk.js} +180 -62
- package/dist/web-extension-cjs/register-Bj5RraXk.js.map +1 -0
- package/dist/web-extension-cjs/src/core/persistence/index.d.ts +1 -0
- package/dist/web-extension-cjs/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/dist/web-extension-esm/auth-web-extension-public.d.ts +1 -0
- package/dist/web-extension-esm/auth-web-extension.d.ts +1 -0
- package/dist/web-extension-esm/index.js +2 -2
- package/dist/web-extension-esm/internal.js +2 -2
- package/dist/web-extension-esm/{register-DBjcU-NC.js → register-B2Dp0WV3.js} +180 -62
- package/dist/web-extension-esm/register-B2Dp0WV3.js.map +1 -0
- package/dist/web-extension-esm/src/core/persistence/index.d.ts +1 -0
- package/dist/web-extension-esm/src/platform_browser/persistence/indexed_db.d.ts +18 -4
- package/package.json +1 -1
- package/dist/browser-cjs/index-DTUcAMkM.js.map +0 -1
- package/dist/cordova/popup_redirect-xyFFcAgj.js.map +0 -1
- package/dist/esm/index-Bz2J43nW.js.map +0 -1
- package/dist/node/totp-CMTC0AYP.js.map +0 -1
- package/dist/node-esm/totp-pe8Y0u5S.js.map +0 -1
- package/dist/rn/index-DzY9h3Kn.js.map +0 -1
- package/dist/web-extension-cjs/register-CTiLN4Sf.js.map +0 -1
- package/dist/web-extension-esm/register-DBjcU-NC.js.map +0 -1
|
@@ -17,13 +17,27 @@
|
|
|
17
17
|
import { Persistence } from '../../model/public_types';
|
|
18
18
|
import { PersistenceValue } from '../../core/persistence/';
|
|
19
19
|
export declare const DB_NAME = "firebaseLocalStorageDb";
|
|
20
|
+
export declare const _POLLING_INTERVAL_MS = 800;
|
|
21
|
+
export declare const _TRANSACTION_RETRY_COUNT = 3;
|
|
22
|
+
/**
|
|
23
|
+
* Short timeout scoped to the `readwrite` availability probe in `_isAvailable()`.
|
|
24
|
+
* Matches `_POLLING_INTERVAL_MS` so that if a background tab is suspended while
|
|
25
|
+
* holding a `readonly` poll transaction that blocks `readwrite` transactions
|
|
26
|
+
* (#10540), the startup probe fails fast and aborts its queued transaction in
|
|
27
|
+
* under a second without blocking fallback or user loading.
|
|
28
|
+
*/
|
|
29
|
+
export declare const _DB_PROBE_TIMEOUT_MS = 800;
|
|
30
|
+
/**
|
|
31
|
+
* Timeout for opening the database and regular IndexedDB read/write requests.
|
|
32
|
+
* Kept at multiple seconds to accommodate cold `indexedDB.open()` or slow disk
|
|
33
|
+
* I/O on low-end devices without premature timeouts.
|
|
34
|
+
*/
|
|
35
|
+
export declare const _DB_TIMEOUT_MS = 2500;
|
|
20
36
|
export declare function _clearDatabase(db: IDBDatabase): Promise<void>;
|
|
21
37
|
export declare function _deleteDatabase(): Promise<void>;
|
|
22
38
|
export declare function _openDatabase(): Promise<IDBDatabase>;
|
|
23
|
-
export declare function _putObject(db: IDBDatabase, key: string, value: PersistenceValue | string): Promise<void>;
|
|
24
|
-
export declare function _deleteObject(db: IDBDatabase, key: string): Promise<void>;
|
|
25
|
-
export declare const _POLLING_INTERVAL_MS = 800;
|
|
26
|
-
export declare const _TRANSACTION_RETRY_COUNT = 3;
|
|
39
|
+
export declare function _putObject(db: IDBDatabase, key: string, value: PersistenceValue | string, timeoutMs?: number): Promise<void>;
|
|
40
|
+
export declare function _deleteObject(db: IDBDatabase, key: string, timeoutMs?: number): Promise<void>;
|
|
27
41
|
/**
|
|
28
42
|
* An implementation of {@link Persistence} of type `LOCAL` using `indexedDB`
|
|
29
43
|
* for the underlying storage.
|
|
@@ -2126,31 +2126,25 @@ class PersistenceUserManager {
|
|
|
2126
2126
|
if (!persistenceHierarchy.length) {
|
|
2127
2127
|
return new PersistenceUserManager(_getInstance(inMemoryPersistence), auth, userKey);
|
|
2128
2128
|
}
|
|
2129
|
-
|
|
2130
|
-
|
|
2129
|
+
const key = _persistenceKeyName(userKey, auth.config.apiKey, auth.name);
|
|
2130
|
+
// Search for an existing user across all persistences before running `_isAvailable()`.
|
|
2131
|
+
// `_get` only opens a `readonly` transaction in IndexedDB, whereas `_isAvailable()` opens
|
|
2132
|
+
// a `readwrite` transaction; if another tab is suspended holding a `readonly` transaction
|
|
2133
|
+
// (#10540), queuing a `readwrite` transaction first blocks subsequent `readonly` transactions
|
|
2134
|
+
// in the browser's IndexedDB lock manager.
|
|
2135
|
+
let foundUser = null;
|
|
2136
|
+
let foundPersistence = null;
|
|
2137
|
+
const unreadablePersistences = new Set();
|
|
2138
|
+
for (const persistence of persistenceHierarchy) {
|
|
2139
|
+
let blob = null;
|
|
2131
2140
|
try {
|
|
2132
|
-
|
|
2133
|
-
return persistence;
|
|
2134
|
-
}
|
|
2141
|
+
blob = await persistence._get(key);
|
|
2135
2142
|
}
|
|
2136
2143
|
catch {
|
|
2137
|
-
|
|
2144
|
+
unreadablePersistences.add(persistence);
|
|
2145
|
+
continue;
|
|
2138
2146
|
}
|
|
2139
|
-
return undefined;
|
|
2140
|
-
}))).filter(persistence => persistence);
|
|
2141
|
-
// Fall back to the first persistence listed, or in memory if none available
|
|
2142
|
-
let selectedPersistence = availablePersistences[0] ||
|
|
2143
|
-
_getInstance(inMemoryPersistence);
|
|
2144
|
-
const key = _persistenceKeyName(userKey, auth.config.apiKey, auth.name);
|
|
2145
|
-
// Pull out the existing user, setting the chosen persistence to that
|
|
2146
|
-
// persistence if the user exists.
|
|
2147
|
-
let userToMigrate = null;
|
|
2148
|
-
// Note, here we check for a user in _all_ persistences, not just the
|
|
2149
|
-
// ones deemed available. If we can migrate a user out of a broken
|
|
2150
|
-
// persistence, we will (but only if that persistence supports migration).
|
|
2151
|
-
for (const persistence of persistenceHierarchy) {
|
|
2152
2147
|
try {
|
|
2153
|
-
const blob = await persistence._get(key);
|
|
2154
2148
|
if (blob) {
|
|
2155
2149
|
let user;
|
|
2156
2150
|
if (typeof blob === 'string') {
|
|
@@ -2165,15 +2159,38 @@ class PersistenceUserManager {
|
|
|
2165
2159
|
else {
|
|
2166
2160
|
user = UserImpl._fromJSON(auth, blob); // throws for unparsable blob (wrong format)
|
|
2167
2161
|
}
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
}
|
|
2171
|
-
selectedPersistence = persistence;
|
|
2162
|
+
foundUser = user;
|
|
2163
|
+
foundPersistence = persistence;
|
|
2172
2164
|
break;
|
|
2173
2165
|
}
|
|
2174
2166
|
}
|
|
2175
2167
|
catch { }
|
|
2176
2168
|
}
|
|
2169
|
+
// Eliminate any persistences that are not available
|
|
2170
|
+
const availablePersistences = (await Promise.all(persistenceHierarchy.map(async (persistence) => {
|
|
2171
|
+
try {
|
|
2172
|
+
if (await persistence._isAvailable()) {
|
|
2173
|
+
return persistence;
|
|
2174
|
+
}
|
|
2175
|
+
if (persistence._lastProbeTimedOut) {
|
|
2176
|
+
unreadablePersistences.add(persistence);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
catch {
|
|
2180
|
+
return undefined;
|
|
2181
|
+
}
|
|
2182
|
+
return undefined;
|
|
2183
|
+
}))).filter(persistence => persistence);
|
|
2184
|
+
// Fall back to the first persistence listed, or in memory if none available
|
|
2185
|
+
let selectedPersistence = availablePersistences[0] ||
|
|
2186
|
+
_getInstance(inMemoryPersistence);
|
|
2187
|
+
let userToMigrate = null;
|
|
2188
|
+
if (foundPersistence && foundUser) {
|
|
2189
|
+
if (foundPersistence !== selectedPersistence) {
|
|
2190
|
+
userToMigrate = foundUser;
|
|
2191
|
+
}
|
|
2192
|
+
selectedPersistence = foundPersistence;
|
|
2193
|
+
}
|
|
2177
2194
|
// If we find the user in a persistence that does support migration, use
|
|
2178
2195
|
// that migration path (of only persistences that support migration)
|
|
2179
2196
|
const migrationHierarchy = availablePersistences.filter(p => p._shouldAllowMigration);
|
|
@@ -2188,10 +2205,13 @@ class PersistenceUserManager {
|
|
|
2188
2205
|
// we'll just let it bubble to surface the error.
|
|
2189
2206
|
await selectedPersistence._set(key, userToMigrate.toJSON());
|
|
2190
2207
|
}
|
|
2191
|
-
// Attempt to clear the key in other persistences
|
|
2192
|
-
//
|
|
2208
|
+
// Attempt to clear the key in other persistences (except those whose _get threw or whose
|
|
2209
|
+
// _isAvailable() probe timed out, so we never delete from a store we couldn't read or that
|
|
2210
|
+
// is blocked by another tab) and ignore errors. This helps prevent issues such as users
|
|
2211
|
+
// getting stuck with a previous account after signing out and refreshing the tab.
|
|
2193
2212
|
await Promise.all(persistenceHierarchy.map(async (persistence) => {
|
|
2194
|
-
if (persistence !== selectedPersistence
|
|
2213
|
+
if (persistence !== selectedPersistence &&
|
|
2214
|
+
!unreadablePersistences.has(persistence)) {
|
|
2195
2215
|
try {
|
|
2196
2216
|
await persistence._remove(key);
|
|
2197
2217
|
}
|
|
@@ -2710,7 +2730,6 @@ class AuthImpl {
|
|
|
2710
2730
|
}
|
|
2711
2731
|
catch (e) {
|
|
2712
2732
|
_logWarn(`Failed to initialize current user: ${e}`);
|
|
2713
|
-
await this.directlySetCurrentUser(null).catch(() => { });
|
|
2714
2733
|
}
|
|
2715
2734
|
this.lastNotifiedUid = this.currentUser?.uid || null;
|
|
2716
2735
|
if (this._deleted) {
|
|
@@ -7239,7 +7258,7 @@ function multiFactor(user) {
|
|
|
7239
7258
|
}
|
|
7240
7259
|
|
|
7241
7260
|
var name = "@firebase/auth";
|
|
7242
|
-
var version = "1.13.
|
|
7261
|
+
var version = "1.13.10-20261111165442";
|
|
7243
7262
|
|
|
7244
7263
|
/**
|
|
7245
7264
|
* @license
|
|
@@ -7649,4 +7668,4 @@ function _isEmptyString(input) {
|
|
|
7649
7668
|
}
|
|
7650
7669
|
|
|
7651
7670
|
export { onIdTokenChanged as $, ActionCodeOperation as A, fetchSignInMethodsForEmail as B, getAdditionalUserInfo as C, getAuth as D, EmailAuthCredential as E, FacebookAuthProvider as F, GithubAuthProvider as G, getIdToken as H, getIdTokenResult as I, getMultiFactorResolver as J, getRedirectResult as K, inMemoryPersistence as L, indexedDBLocalPersistence as M, initializeAuth as N, OAuthCredential as O, PhoneAuthCredential as P, initializeRecaptchaConfig as Q, RecaptchaVerifier as R, SAMLAuthProvider as S, TotpMultiFactorGenerator as T, isSignInWithEmailLink as U, linkWithCredential as V, linkWithPhoneNumber as W, linkWithPopup as X, linkWithRedirect as Y, multiFactor as Z, onAuthStateChanged as _, ActionCodeURL as a, parseActionCodeURL as a0, prodErrorMap as a1, reauthenticateWithCredential as a2, reauthenticateWithPhoneNumber as a3, reauthenticateWithPopup as a4, reauthenticateWithRedirect as a5, reload as a6, revokeAccessToken as a7, sendEmailVerification as a8, sendPasswordResetEmail as a9, signInWithIdp as aA, _fail as aB, debugAssert as aC, _persistenceKeyName as aD, _serverAppCurrentUserOperationNotSupportedError as aE, _castAuth as aF, FederatedAuthProvider as aG, BaseOAuthProvider as aH, _emulatorUrl as aI, _performApiRequest as aJ, _isIOS as aK, _isAndroid as aL, _isIOS7Or8 as aM, _createError as aN, _isMobileBrowser as aO, _isIE10 as aP, AuthImpl as aQ, FetchProvider as aR, SAMLAuthCredential as aS, UserImpl as aT, _getClientVersion as aU, sendSignInLinkToEmail as aa, setPersistence as ab, signInAnonymously as ac, signInWithCredential as ad, signInWithCustomToken as ae, signInWithEmailAndPassword as af, signInWithEmailLink as ag, signInWithPhoneNumber as ah, signInWithPopup as ai, signInWithRedirect as aj, signOut as ak, unlink as al, updateCurrentUser as am, updateEmail as an, updatePassword as ao, updatePhoneNumber as ap, updateProfile as aq, useDeviceLanguage as ar, validatePassword as as, verifyBeforeUpdateEmail as at, verifyPasswordResetCode as au, _getInstance as av, _assert as aw, _reauthenticate as ax, _link as ay, _signInWithCredential as az, AuthCredential as b, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as c, EmailAuthProvider as d, FactorId as e, GoogleAuthProvider as f, OAuthProvider as g, OperationType as h, PhoneAuthProvider as i, PhoneMultiFactorGenerator as j, ProviderId as k, SignInMethod as l, TotpSecret as m, TwitterAuthProvider as n, applyActionCode as o, beforeAuthStateChanged as p, browserCookiePersistence as q, browserLocalPersistence as r, browserPopupRedirectResolver as s, browserSessionPersistence as t, checkActionCode as u, confirmPasswordReset as v, connectAuthEmulator as w, createUserWithEmailAndPassword as x, debugErrorMap as y, deleteUser as z };
|
|
7652
|
-
//# sourceMappingURL=totp-
|
|
7671
|
+
//# sourceMappingURL=totp-BIzof36h.js.map
|