@firebase/auth 0.20.3 → 0.20.4-20220621210445
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 +9 -0
- package/dist/auth-public.d.ts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +3 -3
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-9ed330a1.js → popup_redirect-afabf63c.js} +38 -33
- package/dist/cordova/popup_redirect-afabf63c.js.map +1 -0
- package/dist/cordova/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/esm2017/{index-69ab4e3a.js → index-9e3ee486.js} +13 -8
- package/dist/esm2017/index-9e3ee486.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/esm5/{index-81005f8a.js → index-95f20717.js} +39 -34
- package/dist/esm5/index-95f20717.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/index.webworker.esm5.js +37 -32
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-007f80f6.js → index-26342bb1.js} +38 -33
- package/dist/node/index-26342bb1.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/node-esm/{index-b1f59f63.js → index-6f071fc8.js} +12 -7
- package/dist/node-esm/index-6f071fc8.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/platform_browser/providers/phone.d.ts +1 -1
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +1 -1
- package/dist/rn/{phone-d791a05d.js → phone-d23325d1.js} +39 -34
- package/dist/rn/phone-d23325d1.js.map +1 -0
- package/dist/rn/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/src/platform_browser/providers/phone.d.ts +1 -1
- package/package.json +5 -5
- package/dist/cordova/popup_redirect-9ed330a1.js.map +0 -1
- package/dist/esm2017/index-69ab4e3a.js.map +0 -1
- package/dist/esm5/index-81005f8a.js.map +0 -1
- package/dist/node/index-007f80f6.js.map +0 -1
- package/dist/node-esm/index-b1f59f63.js.map +0 -1
- package/dist/rn/phone-d791a05d.js.map +0 -1
package/dist/node/index.js
CHANGED
package/dist/node/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-26342bb1.js');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var util = require('@firebase/util');
|
|
8
8
|
var app = require('@firebase/app');
|
|
@@ -133,7 +133,7 @@ export declare class PhoneAuthProvider {
|
|
|
133
133
|
* auth.currentUser,
|
|
134
134
|
* PhoneAuthProvider.credential(verificationId, code));
|
|
135
135
|
* } catch (e) {
|
|
136
|
-
* if (e
|
|
136
|
+
* if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {
|
|
137
137
|
* const cred = PhoneAuthProvider.credentialFromError(e);
|
|
138
138
|
* await linkWithCredential(auth.currentUser, cred);
|
|
139
139
|
* }
|
|
@@ -1149,6 +1149,7 @@ function secondsStringToMilliseconds(seconds) {
|
|
|
1149
1149
|
return Number(seconds) * 1000;
|
|
1150
1150
|
}
|
|
1151
1151
|
function _parseToken(token) {
|
|
1152
|
+
var _a;
|
|
1152
1153
|
const [algorithm, payload, signature] = token.split('.');
|
|
1153
1154
|
if (algorithm === undefined ||
|
|
1154
1155
|
payload === undefined ||
|
|
@@ -1165,7 +1166,7 @@ function _parseToken(token) {
|
|
|
1165
1166
|
return JSON.parse(decoded);
|
|
1166
1167
|
}
|
|
1167
1168
|
catch (e) {
|
|
1168
|
-
_logError('Caught error parsing JWT payload as JSON', e);
|
|
1169
|
+
_logError('Caught error parsing JWT payload as JSON', (_a = e) === null || _a === void 0 ? void 0 : _a.toString());
|
|
1169
1170
|
return null;
|
|
1170
1171
|
}
|
|
1171
1172
|
}
|
|
@@ -1286,12 +1287,13 @@ class ProactiveRefresh {
|
|
|
1286
1287
|
}, interval);
|
|
1287
1288
|
}
|
|
1288
1289
|
async iteration() {
|
|
1290
|
+
var _a;
|
|
1289
1291
|
try {
|
|
1290
1292
|
await this.user.getIdToken(true);
|
|
1291
1293
|
}
|
|
1292
1294
|
catch (e) {
|
|
1293
1295
|
// Only retry on network errors
|
|
1294
|
-
if (e.code === `auth/${"network-request-failed" /* NETWORK_REQUEST_FAILED */}`) {
|
|
1296
|
+
if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) === `auth/${"network-request-failed" /* NETWORK_REQUEST_FAILED */}`) {
|
|
1295
1297
|
this.schedule(/* wasError */ true);
|
|
1296
1298
|
}
|
|
1297
1299
|
return;
|
|
@@ -2378,11 +2380,12 @@ class AuthImpl {
|
|
|
2378
2380
|
return result;
|
|
2379
2381
|
}
|
|
2380
2382
|
async reloadAndSetCurrentUserOrClear(user) {
|
|
2383
|
+
var _a;
|
|
2381
2384
|
try {
|
|
2382
2385
|
await _reloadWithoutSaving(user);
|
|
2383
2386
|
}
|
|
2384
2387
|
catch (e) {
|
|
2385
|
-
if (e.code !== `auth/${"network-request-failed" /* NETWORK_REQUEST_FAILED */}`) {
|
|
2388
|
+
if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) !== `auth/${"network-request-failed" /* NETWORK_REQUEST_FAILED */}`) {
|
|
2386
2389
|
// Something's wrong with the user's token. Log them out and remove
|
|
2387
2390
|
// them from storage
|
|
2388
2391
|
return this.directlySetCurrentUser(null);
|
|
@@ -4651,6 +4654,7 @@ async function _assertLinkedStatus(expected, user, provider) {
|
|
|
4651
4654
|
* limitations under the License.
|
|
4652
4655
|
*/
|
|
4653
4656
|
async function _reauthenticate(user, credential, bypassAuthState = false) {
|
|
4657
|
+
var _a;
|
|
4654
4658
|
const { auth } = user;
|
|
4655
4659
|
const operationType = "reauthenticate" /* REAUTHENTICATE */;
|
|
4656
4660
|
try {
|
|
@@ -4664,7 +4668,7 @@ async function _reauthenticate(user, credential, bypassAuthState = false) {
|
|
|
4664
4668
|
}
|
|
4665
4669
|
catch (e) {
|
|
4666
4670
|
// Convert user deleted error into user mismatch
|
|
4667
|
-
if ((e === null ||
|
|
4671
|
+
if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) === `auth/${"user-not-found" /* USER_DELETED */}`) {
|
|
4668
4672
|
_fail(auth, "user-mismatch" /* USER_MISMATCH */);
|
|
4669
4673
|
}
|
|
4670
4674
|
throw e;
|
|
@@ -5905,6 +5909,7 @@ class MultiFactorUserImpl {
|
|
|
5905
5909
|
return this.user.reload();
|
|
5906
5910
|
}
|
|
5907
5911
|
async unenroll(infoOrUid) {
|
|
5912
|
+
var _a;
|
|
5908
5913
|
const mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;
|
|
5909
5914
|
const idToken = await this.user.getIdToken();
|
|
5910
5915
|
const idTokenResponse = await _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {
|
|
@@ -5922,7 +5927,7 @@ class MultiFactorUserImpl {
|
|
|
5922
5927
|
await this.user.reload();
|
|
5923
5928
|
}
|
|
5924
5929
|
catch (e) {
|
|
5925
|
-
if (e.code !== `auth/${"user-token-expired" /* TOKEN_EXPIRED */}`) {
|
|
5930
|
+
if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) !== `auth/${"user-token-expired" /* TOKEN_EXPIRED */}`) {
|
|
5926
5931
|
throw e;
|
|
5927
5932
|
}
|
|
5928
5933
|
}
|
|
@@ -5948,7 +5953,7 @@ function multiFactor(user) {
|
|
|
5948
5953
|
}
|
|
5949
5954
|
|
|
5950
5955
|
var name = "@firebase/auth";
|
|
5951
|
-
var version = "0.20.
|
|
5956
|
+
var version = "0.20.4-20220621210445";
|
|
5952
5957
|
|
|
5953
5958
|
/**
|
|
5954
5959
|
* @license
|
|
@@ -6175,4 +6180,4 @@ class PhoneMultiFactorGenerator {
|
|
|
6175
6180
|
AuthImpl.prototype.setPersistence = async () => { };
|
|
6176
6181
|
|
|
6177
6182
|
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, BaseOAuthProvider as aA, _emulatorUrl as aB, _performApiRequest as aC, _isIOS7Or8 as aD, _isIOS as aE, _isAndroid as aF, _createError as aG, _isSafari as aH, _isIframe as aI, _isMobileBrowser as aJ, _isIE10 as aK, UserImpl as aL, AuthImpl as aM, _getClientVersion as aN, FetchProvider as aO, SAMLAuthCredential as aP, 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, _getInstance as ap, _assert as aq, _signInWithCredential as ar, _reauthenticate as as, _link as at, signInWithIdp as au, _fail as av, debugAssert as aw, _persistenceKeyName as ax, _castAuth as ay, FederatedAuthProvider 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 };
|
|
6178
|
-
//# sourceMappingURL=index-
|
|
6183
|
+
//# sourceMappingURL=index-6f071fc8.js.map
|