@firebase/auth 1.13.5 → 1.13.6
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 +4 -1
- package/dist/auth.d.ts +5 -1
- package/dist/browser-cjs/{index-DY73Er5u.js → index-DBOuNQej.js} +75 -24
- package/dist/browser-cjs/index-DBOuNQej.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/user/account_info.d.ts +1 -1
- package/dist/cordova/auth-cordova-public.d.ts +4 -1
- package/dist/cordova/auth-cordova.d.ts +5 -1
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +2 -2
- package/dist/cordova/{popup_redirect-D_ZWtJhY.js → popup_redirect-CHQiJtfZ.js} +75 -24
- package/dist/cordova/popup_redirect-CHQiJtfZ.js.map +1 -0
- package/dist/cordova/src/core/user/account_info.d.ts +1 -1
- package/dist/cordova/tsdoc-metadata.json +1 -1
- package/dist/esm/{index-CvXU3_1x.js → index-4NFEPWkC.js} +75 -24
- package/dist/esm/index-4NFEPWkC.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal.js +2 -2
- package/dist/esm/src/core/user/account_info.d.ts +1 -1
- package/dist/index.webworker.js +74 -23
- 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/src/core/user/account_info.d.ts +1 -1
- package/dist/node/{totp-B19JzI52.js → totp-C8DKrPQi.js} +69 -16
- package/dist/node/totp-C8DKrPQi.js.map +1 -0
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/src/core/user/account_info.d.ts +1 -1
- package/dist/node-esm/{totp-C24pd8aS.js → totp-BU9AvxK8.js} +69 -16
- package/dist/node-esm/totp-BU9AvxK8.js.map +1 -0
- package/dist/rn/{index-CiDS6PaG.js → index-DSVEw5ju.js} +69 -16
- package/dist/rn/index-DSVEw5ju.js.map +1 -0
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +7 -9
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/src/core/user/account_info.d.ts +1 -1
- package/dist/src/core/user/account_info.d.ts +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/web-extension-cjs/index.js +1 -1
- package/dist/web-extension-cjs/internal.js +1 -1
- package/dist/web-extension-cjs/{register-dQ43sygv.js → register-eaUKtaNP.js} +75 -24
- package/dist/web-extension-cjs/register-eaUKtaNP.js.map +1 -0
- package/dist/web-extension-cjs/src/core/user/account_info.d.ts +1 -1
- package/dist/web-extension-esm/auth-web-extension-public.d.ts +1 -1
- package/dist/web-extension-esm/auth-web-extension.d.ts +1 -1
- package/dist/web-extension-esm/index.js +2 -2
- package/dist/web-extension-esm/internal.js +2 -2
- package/dist/web-extension-esm/{register-DN05P0kB.js → register-CPcgXhGD.js} +75 -24
- package/dist/web-extension-esm/register-CPcgXhGD.js.map +1 -0
- package/dist/web-extension-esm/src/core/user/account_info.d.ts +1 -1
- package/dist/web-extension-esm/tsdoc-metadata.json +1 -1
- package/package.json +3 -3
- package/dist/browser-cjs/index-DY73Er5u.js.map +0 -1
- package/dist/cordova/popup_redirect-D_ZWtJhY.js.map +0 -1
- package/dist/esm/index-CvXU3_1x.js.map +0 -1
- package/dist/node/totp-B19JzI52.js.map +0 -1
- package/dist/node-esm/totp-C24pd8aS.js.map +0 -1
- package/dist/rn/index-CiDS6PaG.js.map +0 -1
- package/dist/web-extension-cjs/register-dQ43sygv.js.map +0 -1
- package/dist/web-extension-esm/register-DN05P0kB.js.map +0 -1
|
@@ -23,7 +23,7 @@ import { User } from '../../model/public_types';
|
|
|
23
23
|
*
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
|
-
export declare function updateProfile(user: User,
|
|
26
|
+
export declare function updateProfile(user: User, profile: {
|
|
27
27
|
displayName?: string | null;
|
|
28
28
|
photoURL?: string | null;
|
|
29
29
|
}): Promise<void>;
|
|
@@ -2089,7 +2089,12 @@ class PersistenceUserManager {
|
|
|
2089
2089
|
this.fullUserKey = _persistenceKeyName(this.userKey, config.apiKey, name);
|
|
2090
2090
|
this.fullPersistenceKey = _persistenceKeyName("persistence" /* KeyName.PERSISTENCE_USER */, config.apiKey, name);
|
|
2091
2091
|
this.boundEventHandler = auth._onStorageEvent.bind(auth);
|
|
2092
|
-
|
|
2092
|
+
try {
|
|
2093
|
+
this.persistence._addListener(this.fullUserKey, this.boundEventHandler);
|
|
2094
|
+
}
|
|
2095
|
+
catch {
|
|
2096
|
+
// Best effort; ignore errors if addListener throws
|
|
2097
|
+
}
|
|
2093
2098
|
}
|
|
2094
2099
|
setCurrentUser(user) {
|
|
2095
2100
|
return this.persistence._set(this.fullUserKey, user.toJSON());
|
|
@@ -2126,7 +2131,10 @@ class PersistenceUserManager {
|
|
|
2126
2131
|
}
|
|
2127
2132
|
}
|
|
2128
2133
|
delete() {
|
|
2129
|
-
|
|
2134
|
+
try {
|
|
2135
|
+
this.persistence._removeListener(this.fullUserKey, this.boundEventHandler);
|
|
2136
|
+
}
|
|
2137
|
+
catch { }
|
|
2130
2138
|
}
|
|
2131
2139
|
static async create(auth, persistenceHierarchy, userKey = "authUser" /* KeyName.AUTH_USER */) {
|
|
2132
2140
|
if (!persistenceHierarchy.length) {
|
|
@@ -2134,8 +2142,13 @@ class PersistenceUserManager {
|
|
|
2134
2142
|
}
|
|
2135
2143
|
// Eliminate any persistences that are not available
|
|
2136
2144
|
const availablePersistences = (await Promise.all(persistenceHierarchy.map(async (persistence) => {
|
|
2137
|
-
|
|
2138
|
-
|
|
2145
|
+
try {
|
|
2146
|
+
if (await persistence._isAvailable()) {
|
|
2147
|
+
return persistence;
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
catch {
|
|
2151
|
+
return undefined;
|
|
2139
2152
|
}
|
|
2140
2153
|
return undefined;
|
|
2141
2154
|
}))).filter(persistence => persistence);
|
|
@@ -2685,8 +2698,16 @@ class AuthImpl {
|
|
|
2685
2698
|
if (this._deleted) {
|
|
2686
2699
|
return;
|
|
2687
2700
|
}
|
|
2688
|
-
|
|
2689
|
-
|
|
2701
|
+
try {
|
|
2702
|
+
this.persistenceManager = await PersistenceUserManager.create(this, persistenceHierarchy);
|
|
2703
|
+
}
|
|
2704
|
+
catch (e) {
|
|
2705
|
+
_logWarn(`Failed to initialize persistence: ${e}`);
|
|
2706
|
+
this.persistenceManager = await PersistenceUserManager.create(this, []);
|
|
2707
|
+
}
|
|
2708
|
+
finally {
|
|
2709
|
+
this._resolvePersistenceManagerAvailable?.();
|
|
2710
|
+
}
|
|
2690
2711
|
if (this._deleted) {
|
|
2691
2712
|
return;
|
|
2692
2713
|
}
|
|
@@ -2701,7 +2722,13 @@ class AuthImpl {
|
|
|
2701
2722
|
/* Ignore the error */
|
|
2702
2723
|
}
|
|
2703
2724
|
}
|
|
2704
|
-
|
|
2725
|
+
try {
|
|
2726
|
+
await this.initializeCurrentUser(popupRedirectResolver);
|
|
2727
|
+
}
|
|
2728
|
+
catch (e) {
|
|
2729
|
+
_logWarn(`Failed to initialize current user: ${e}`);
|
|
2730
|
+
await this.directlySetCurrentUser(null).catch(() => { });
|
|
2731
|
+
}
|
|
2705
2732
|
this.lastNotifiedUid = this.currentUser?.uid || null;
|
|
2706
2733
|
if (this._deleted) {
|
|
2707
2734
|
return;
|
|
@@ -3099,11 +3126,26 @@ class AuthImpl {
|
|
|
3099
3126
|
_assert(promise, this, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
3100
3127
|
// The callback needs to be called asynchronously per the spec.
|
|
3101
3128
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
3102
|
-
promise
|
|
3129
|
+
promise
|
|
3130
|
+
.then(() => {
|
|
3103
3131
|
if (isUnsubscribed) {
|
|
3104
3132
|
return;
|
|
3105
3133
|
}
|
|
3106
3134
|
cb(this.currentUser);
|
|
3135
|
+
})
|
|
3136
|
+
.catch(err => {
|
|
3137
|
+
if (isUnsubscribed) {
|
|
3138
|
+
return;
|
|
3139
|
+
}
|
|
3140
|
+
if (typeof nextOrObserver !== 'function' && nextOrObserver.error) {
|
|
3141
|
+
nextOrObserver.error(err);
|
|
3142
|
+
}
|
|
3143
|
+
else if (error) {
|
|
3144
|
+
error(err);
|
|
3145
|
+
}
|
|
3146
|
+
else {
|
|
3147
|
+
throw err;
|
|
3148
|
+
}
|
|
3107
3149
|
});
|
|
3108
3150
|
if (typeof nextOrObserver === 'function') {
|
|
3109
3151
|
const unsubscribe = subscription.addObserver(nextOrObserver, error, completed);
|
|
@@ -3133,11 +3175,21 @@ class AuthImpl {
|
|
|
3133
3175
|
user._startProactiveRefresh();
|
|
3134
3176
|
}
|
|
3135
3177
|
this.currentUser = user;
|
|
3136
|
-
if (
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3178
|
+
if (this.persistenceManager) {
|
|
3179
|
+
try {
|
|
3180
|
+
if (user) {
|
|
3181
|
+
await this.persistenceManager.setCurrentUser(user);
|
|
3182
|
+
}
|
|
3183
|
+
else {
|
|
3184
|
+
await this.persistenceManager.removeCurrentUser();
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
catch (e) {
|
|
3188
|
+
const originalMessage = e?.message || String(e);
|
|
3189
|
+
const error = _errorWithCustomMessage(this, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */, `An internal AuthError has occurred: ${originalMessage}`);
|
|
3190
|
+
error.customData = { originalError: e };
|
|
3191
|
+
throw error;
|
|
3192
|
+
}
|
|
3141
3193
|
}
|
|
3142
3194
|
}
|
|
3143
3195
|
queue(action) {
|
|
@@ -6714,7 +6766,8 @@ async function updateProfile$1(auth, request) {
|
|
|
6714
6766
|
*
|
|
6715
6767
|
* @public
|
|
6716
6768
|
*/
|
|
6717
|
-
async function updateProfile(user,
|
|
6769
|
+
async function updateProfile(user, profile) {
|
|
6770
|
+
const { displayName, photoURL: photoUrl } = profile;
|
|
6718
6771
|
if (displayName === undefined && photoUrl === undefined) {
|
|
6719
6772
|
return;
|
|
6720
6773
|
}
|
|
@@ -8295,9 +8348,6 @@ class IndexedDBLocalPersistence {
|
|
|
8295
8348
|
this.initializeServiceWorkerMessaging().then(() => { }, () => { });
|
|
8296
8349
|
}
|
|
8297
8350
|
async _openDb() {
|
|
8298
|
-
if (this.isClosing) {
|
|
8299
|
-
throw new Error('Database is closing');
|
|
8300
|
-
}
|
|
8301
8351
|
if (this.dbPromise) {
|
|
8302
8352
|
return this.dbPromise;
|
|
8303
8353
|
}
|
|
@@ -8315,16 +8365,17 @@ class IndexedDBLocalPersistence {
|
|
|
8315
8365
|
return await op(db);
|
|
8316
8366
|
}
|
|
8317
8367
|
catch (e) {
|
|
8318
|
-
if (this.isClosing) {
|
|
8319
|
-
throw e;
|
|
8320
|
-
}
|
|
8321
8368
|
if (numAttempts++ > _TRANSACTION_RETRY_COUNT) {
|
|
8322
8369
|
throw e;
|
|
8323
8370
|
}
|
|
8324
8371
|
if (this.dbPromise) {
|
|
8325
|
-
const
|
|
8326
|
-
db.close();
|
|
8372
|
+
const dbPromise = this.dbPromise;
|
|
8327
8373
|
this.dbPromise = null;
|
|
8374
|
+
try {
|
|
8375
|
+
const db = await dbPromise;
|
|
8376
|
+
db.close();
|
|
8377
|
+
}
|
|
8378
|
+
catch { }
|
|
8328
8379
|
}
|
|
8329
8380
|
// TODO: consider adding exponential backoff
|
|
8330
8381
|
}
|
|
@@ -11014,7 +11065,7 @@ function _isEmptyString(input) {
|
|
|
11014
11065
|
}
|
|
11015
11066
|
|
|
11016
11067
|
var name = "@firebase/auth";
|
|
11017
|
-
var version = "1.13.
|
|
11068
|
+
var version = "1.13.6";
|
|
11018
11069
|
|
|
11019
11070
|
/**
|
|
11020
11071
|
* @license
|
|
@@ -11267,4 +11318,4 @@ _setExternalJSProvider({
|
|
|
11267
11318
|
registerAuth("Browser" /* ClientPlatform.BROWSER */);
|
|
11268
11319
|
|
|
11269
11320
|
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, _getRedirectUrl as aA, _isIOS7Or8 as aB, _createError as aC, _getProjectConfig as aD, AuthEventManager as aE, _getInstance as aF, _persistenceKeyName as aG, _getRedirectResult as aH, _overrideRedirectResult as aI, _clearRedirectOutcomes as aJ, _castAuth as aK, AuthImpl as aL, AuthPopup as aM, FetchProvider as aN, SAMLAuthCredential as aO, UserImpl as aP, _generateEventId as aQ, _getClientVersion as aR, 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, _assert as av, debugAssert as aw, _isIOS as ax, _isAndroid as ay, _fail 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 };
|
|
11270
|
-
//# sourceMappingURL=index-
|
|
11321
|
+
//# sourceMappingURL=index-4NFEPWkC.js.map
|