@firebase/auth 0.20.2 → 0.20.3-canary.8f826604e
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 +13 -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-e449cb08.js → popup_redirect-12f5d6c2.js} +54 -48
- package/dist/cordova/popup_redirect-12f5d6c2.js.map +1 -0
- package/dist/cordova/src/platform_browser/providers/phone.d.ts +1 -1
- package/dist/esm2017/{index-ccf9d100.js → index-4bec2e89.js} +15 -9
- package/dist/esm2017/index-4bec2e89.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-ea3c621a.js → index-c6e3f457.js} +55 -49
- package/dist/esm5/index-c6e3f457.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 +53 -47
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-cc504aa1.js → index-b07cff58.js} +54 -48
- package/dist/node/index-b07cff58.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-14ee511d.js → index-f35ca0c7.js} +14 -8
- package/dist/node-esm/index-f35ca0c7.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-dd9c6425.js → phone-7ee311f7.js} +55 -49
- package/dist/rn/phone-7ee311f7.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 +39 -14
- package/dist/cordova/popup_redirect-e449cb08.js.map +0 -1
- package/dist/esm2017/index-ccf9d100.js.map +0 -1
- package/dist/esm5/index-ea3c621a.js.map +0 -1
- package/dist/node/index-cc504aa1.js.map +0 -1
- package/dist/node-esm/index-14ee511d.js.map +0 -1
- package/dist/rn/phone-dd9c6425.js.map +0 -1
package/dist/node-esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-
|
|
1
|
+
export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-f35ca0c7.js';
|
|
2
2
|
import '@firebase/util';
|
|
3
3
|
import '@firebase/app';
|
|
4
4
|
import 'tslib';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ap as _getInstance, aq as _assert, ar as _signInWithCredential, as as _reauthenticate, at as _link$1, H as AuthCredential, au as signInWithIdp, av as _fail, aw as debugAssert, ax as _persistenceKeyName, ay as _castAuth, az as FederatedAuthProvider, aA as BaseOAuthProvider, aB as _emulatorUrl, aC as _performApiRequest, aD as _isIOS7Or8, aE as _isIOS, aF as _isAndroid, aG as _createError, aH as _isSafari, aI as _isIframe, aJ as _isMobileBrowser, aK as _isIE10 } from './index-
|
|
2
|
-
export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, aM as AuthImpl, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, aO as FetchProvider, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aP as SAMLAuthCredential, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, aL as UserImpl, aq as _assert, ay as _castAuth, av as _fail, aN as _getClientVersion, ap as _getInstance, ax as _persistenceKeyName, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-
|
|
1
|
+
import { ap as _getInstance, aq as _assert, ar as _signInWithCredential, as as _reauthenticate, at as _link$1, H as AuthCredential, au as signInWithIdp, av as _fail, aw as debugAssert, ax as _persistenceKeyName, ay as _castAuth, az as FederatedAuthProvider, aA as BaseOAuthProvider, aB as _emulatorUrl, aC as _performApiRequest, aD as _isIOS7Or8, aE as _isIOS, aF as _isAndroid, aG as _createError, aH as _isSafari, aI as _isIframe, aJ as _isMobileBrowser, aK as _isIE10 } from './index-f35ca0c7.js';
|
|
2
|
+
export { A as ActionCodeOperation, ad as ActionCodeURL, H as AuthCredential, D as AuthErrorCodes, aM as AuthImpl, I as EmailAuthCredential, M as EmailAuthProvider, N as FacebookAuthProvider, F as FactorId, aO as FetchProvider, T as GithubAuthProvider, Q as GoogleAuthProvider, J as OAuthCredential, U as OAuthProvider, O as OperationType, K as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aP as SAMLAuthCredential, V as SAMLAuthProvider, S as SignInMethod, W as TwitterAuthProvider, aL as UserImpl, aq as _assert, ay as _castAuth, av as _fail, aN as _getClientVersion, ap as _getInstance, ax as _persistenceKeyName, a2 as applyActionCode, t as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a3 as checkActionCode, a1 as confirmPasswordReset, G as connectAuthEmulator, a5 as createUserWithEmailAndPassword, B as debugErrorMap, z as deleteUser, aa as fetchSignInMethodsForEmail, al as getAdditionalUserInfo, n as getAuth, ai as getIdToken, aj as getIdTokenResult, an as getMultiFactorResolver, j as getRedirectResult, L as inMemoryPersistence, i as indexedDBLocalPersistence, E as initializeAuth, a8 as isSignInWithEmailLink, Z as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ao as multiFactor, v as onAuthStateChanged, q as onIdTokenChanged, ae as parseActionCodeURL, C as prodErrorMap, _ as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, am as reload, ab as sendEmailVerification, a0 as sendPasswordResetEmail, a7 as sendSignInLinkToEmail, p as setPersistence, X as signInAnonymously, Y as signInWithCredential, $ as signInWithCustomToken, a6 as signInWithEmailAndPassword, a9 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, y as signOut, ak as unlink, x as updateCurrentUser, ag as updateEmail, ah as updatePassword, u as updatePhoneNumber, af as updateProfile, w as useDeviceLanguage, ac as verifyBeforeUpdateEmail, a4 as verifyPasswordResetCode } from './index-f35ca0c7.js';
|
|
3
3
|
import { querystring, isEmpty, getUA, querystringDecode } from '@firebase/util';
|
|
4
4
|
import 'tslib';
|
|
5
5
|
import { SDK_VERSION } from '@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
|
* }
|
package/dist/rn/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var ReactNative = require('react-native');
|
|
6
6
|
var app = require('@firebase/app');
|
|
7
|
-
var phone = require('./phone-
|
|
7
|
+
var phone = require('./phone-7ee311f7.js');
|
|
8
8
|
var tslib = require('tslib');
|
|
9
9
|
require('@firebase/util');
|
|
10
10
|
require('@firebase/component');
|
package/dist/rn/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var phone = require('./phone-
|
|
5
|
+
var phone = require('./phone-7ee311f7.js');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var util = require('@firebase/util');
|
|
8
8
|
var app = require('@firebase/app');
|
|
@@ -1157,7 +1157,8 @@ function secondsStringToMilliseconds(seconds) {
|
|
|
1157
1157
|
return Number(seconds) * 1000;
|
|
1158
1158
|
}
|
|
1159
1159
|
function _parseToken(token) {
|
|
1160
|
-
var _a
|
|
1160
|
+
var _a;
|
|
1161
|
+
var _b = token.split('.'), algorithm = _b[0], payload = _b[1], signature = _b[2];
|
|
1161
1162
|
if (algorithm === undefined ||
|
|
1162
1163
|
payload === undefined ||
|
|
1163
1164
|
signature === undefined) {
|
|
@@ -1173,7 +1174,7 @@ function _parseToken(token) {
|
|
|
1173
1174
|
return JSON.parse(decoded);
|
|
1174
1175
|
}
|
|
1175
1176
|
catch (e) {
|
|
1176
|
-
_logError('Caught error parsing JWT payload as JSON', e);
|
|
1177
|
+
_logError('Caught error parsing JWT payload as JSON', (_a = e) === null || _a === void 0 ? void 0 : _a.toString());
|
|
1177
1178
|
return null;
|
|
1178
1179
|
}
|
|
1179
1180
|
}
|
|
@@ -1317,20 +1318,21 @@ var ProactiveRefresh = /** @class */ (function () {
|
|
|
1317
1318
|
}); }, interval);
|
|
1318
1319
|
};
|
|
1319
1320
|
ProactiveRefresh.prototype.iteration = function () {
|
|
1321
|
+
var _a;
|
|
1320
1322
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1321
1323
|
var e_1;
|
|
1322
|
-
return tslib.__generator(this, function (
|
|
1323
|
-
switch (
|
|
1324
|
+
return tslib.__generator(this, function (_b) {
|
|
1325
|
+
switch (_b.label) {
|
|
1324
1326
|
case 0:
|
|
1325
|
-
|
|
1327
|
+
_b.trys.push([0, 2, , 3]);
|
|
1326
1328
|
return [4 /*yield*/, this.user.getIdToken(true)];
|
|
1327
1329
|
case 1:
|
|
1328
|
-
|
|
1330
|
+
_b.sent();
|
|
1329
1331
|
return [3 /*break*/, 3];
|
|
1330
1332
|
case 2:
|
|
1331
|
-
e_1 =
|
|
1333
|
+
e_1 = _b.sent();
|
|
1332
1334
|
// Only retry on network errors
|
|
1333
|
-
if (e_1.code === "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
|
|
1335
|
+
if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
|
|
1334
1336
|
this.schedule(/* wasError */ true);
|
|
1335
1337
|
}
|
|
1336
1338
|
return [2 /*return*/];
|
|
@@ -2419,48 +2421,49 @@ var AuthMiddlewareQueue = /** @class */ (function () {
|
|
|
2419
2421
|
};
|
|
2420
2422
|
};
|
|
2421
2423
|
AuthMiddlewareQueue.prototype.runMiddleware = function (nextUser) {
|
|
2424
|
+
var _a;
|
|
2422
2425
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2423
|
-
var onAbortStack, _i,
|
|
2424
|
-
return tslib.__generator(this, function (
|
|
2425
|
-
switch (
|
|
2426
|
+
var onAbortStack, _i, _b, beforeStateCallback, e_1, _c, onAbortStack_1, onAbort;
|
|
2427
|
+
return tslib.__generator(this, function (_d) {
|
|
2428
|
+
switch (_d.label) {
|
|
2426
2429
|
case 0:
|
|
2427
2430
|
if (this.auth.currentUser === nextUser) {
|
|
2428
2431
|
return [2 /*return*/];
|
|
2429
2432
|
}
|
|
2430
2433
|
onAbortStack = [];
|
|
2431
|
-
|
|
2434
|
+
_d.label = 1;
|
|
2432
2435
|
case 1:
|
|
2433
|
-
|
|
2434
|
-
_i = 0,
|
|
2435
|
-
|
|
2436
|
+
_d.trys.push([1, 6, , 7]);
|
|
2437
|
+
_i = 0, _b = this.queue;
|
|
2438
|
+
_d.label = 2;
|
|
2436
2439
|
case 2:
|
|
2437
|
-
if (!(_i <
|
|
2438
|
-
beforeStateCallback =
|
|
2440
|
+
if (!(_i < _b.length)) return [3 /*break*/, 5];
|
|
2441
|
+
beforeStateCallback = _b[_i];
|
|
2439
2442
|
return [4 /*yield*/, beforeStateCallback(nextUser)];
|
|
2440
2443
|
case 3:
|
|
2441
|
-
|
|
2444
|
+
_d.sent();
|
|
2442
2445
|
// Only push the onAbort if the callback succeeds
|
|
2443
2446
|
if (beforeStateCallback.onAbort) {
|
|
2444
2447
|
onAbortStack.push(beforeStateCallback.onAbort);
|
|
2445
2448
|
}
|
|
2446
|
-
|
|
2449
|
+
_d.label = 4;
|
|
2447
2450
|
case 4:
|
|
2448
2451
|
_i++;
|
|
2449
2452
|
return [3 /*break*/, 2];
|
|
2450
2453
|
case 5: return [3 /*break*/, 7];
|
|
2451
2454
|
case 6:
|
|
2452
|
-
e_1 =
|
|
2455
|
+
e_1 = _d.sent();
|
|
2453
2456
|
// Run all onAbort, with separate try/catch to ignore any errors and
|
|
2454
2457
|
// continue
|
|
2455
2458
|
onAbortStack.reverse();
|
|
2456
|
-
for (
|
|
2457
|
-
onAbort = onAbortStack_1[
|
|
2459
|
+
for (_c = 0, onAbortStack_1 = onAbortStack; _c < onAbortStack_1.length; _c++) {
|
|
2460
|
+
onAbort = onAbortStack_1[_c];
|
|
2458
2461
|
try {
|
|
2459
2462
|
onAbort();
|
|
2460
2463
|
}
|
|
2461
2464
|
catch (_) { /* swallow error */ }
|
|
2462
2465
|
}
|
|
2463
|
-
throw this.auth._errorFactory.create("login-blocked" /* LOGIN_BLOCKED */, { originalMessage: e_1.message });
|
|
2466
|
+
throw this.auth._errorFactory.create("login-blocked" /* LOGIN_BLOCKED */, { originalMessage: (_a = e_1) === null || _a === void 0 ? void 0 : _a.message });
|
|
2464
2467
|
case 7: return [2 /*return*/];
|
|
2465
2468
|
}
|
|
2466
2469
|
});
|
|
@@ -2715,19 +2718,20 @@ var AuthImpl = /** @class */ (function () {
|
|
|
2715
2718
|
});
|
|
2716
2719
|
};
|
|
2717
2720
|
AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
|
|
2721
|
+
var _a;
|
|
2718
2722
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2719
2723
|
var e_4;
|
|
2720
|
-
return tslib.__generator(this, function (
|
|
2721
|
-
switch (
|
|
2724
|
+
return tslib.__generator(this, function (_b) {
|
|
2725
|
+
switch (_b.label) {
|
|
2722
2726
|
case 0:
|
|
2723
|
-
|
|
2727
|
+
_b.trys.push([0, 2, , 3]);
|
|
2724
2728
|
return [4 /*yield*/, _reloadWithoutSaving(user)];
|
|
2725
2729
|
case 1:
|
|
2726
|
-
|
|
2730
|
+
_b.sent();
|
|
2727
2731
|
return [3 /*break*/, 3];
|
|
2728
2732
|
case 2:
|
|
2729
|
-
e_4 =
|
|
2730
|
-
if (e_4.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
|
|
2733
|
+
e_4 = _b.sent();
|
|
2734
|
+
if (((_a = e_4) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
|
|
2731
2735
|
// Something's wrong with the user's token. Log them out and remove
|
|
2732
2736
|
// them from storage
|
|
2733
2737
|
return [2 /*return*/, this.directlySetCurrentUser(null)];
|
|
@@ -5344,20 +5348,21 @@ function _assertLinkedStatus(expected, user, provider) {
|
|
|
5344
5348
|
* limitations under the License.
|
|
5345
5349
|
*/
|
|
5346
5350
|
function _reauthenticate(user, credential, bypassAuthState) {
|
|
5351
|
+
var _a;
|
|
5347
5352
|
if (bypassAuthState === void 0) { bypassAuthState = false; }
|
|
5348
5353
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
5349
5354
|
var auth, operationType, response, parsed, localId, e_1;
|
|
5350
|
-
return tslib.__generator(this, function (
|
|
5351
|
-
switch (
|
|
5355
|
+
return tslib.__generator(this, function (_b) {
|
|
5356
|
+
switch (_b.label) {
|
|
5352
5357
|
case 0:
|
|
5353
5358
|
auth = user.auth;
|
|
5354
5359
|
operationType = "reauthenticate" /* REAUTHENTICATE */;
|
|
5355
|
-
|
|
5360
|
+
_b.label = 1;
|
|
5356
5361
|
case 1:
|
|
5357
|
-
|
|
5362
|
+
_b.trys.push([1, 3, , 4]);
|
|
5358
5363
|
return [4 /*yield*/, _logoutIfInvalidated(user, _processCredentialSavingMfaContextIfNecessary(auth, operationType, credential, user), bypassAuthState)];
|
|
5359
5364
|
case 2:
|
|
5360
|
-
response =
|
|
5365
|
+
response = _b.sent();
|
|
5361
5366
|
_assert(response.idToken, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
5362
5367
|
parsed = _parseToken(response.idToken);
|
|
5363
5368
|
_assert(parsed, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
@@ -5365,9 +5370,9 @@ function _reauthenticate(user, credential, bypassAuthState) {
|
|
|
5365
5370
|
_assert(user.uid === localId, auth, "user-mismatch" /* USER_MISMATCH */);
|
|
5366
5371
|
return [2 /*return*/, UserCredentialImpl._forOperation(user, operationType, response)];
|
|
5367
5372
|
case 3:
|
|
5368
|
-
e_1 =
|
|
5373
|
+
e_1 = _b.sent();
|
|
5369
5374
|
// Convert user deleted error into user mismatch
|
|
5370
|
-
if ((e_1 === null ||
|
|
5375
|
+
if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) === "auth/" + "user-not-found" /* USER_DELETED */) {
|
|
5371
5376
|
_fail(auth, "user-mismatch" /* USER_MISMATCH */);
|
|
5372
5377
|
}
|
|
5373
5378
|
throw e_1;
|
|
@@ -6893,21 +6898,22 @@ var MultiFactorUserImpl = /** @class */ (function () {
|
|
|
6893
6898
|
});
|
|
6894
6899
|
};
|
|
6895
6900
|
MultiFactorUserImpl.prototype.unenroll = function (infoOrUid) {
|
|
6901
|
+
var _a;
|
|
6896
6902
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
6897
6903
|
var mfaEnrollmentId, idToken, idTokenResponse, e_1;
|
|
6898
|
-
return tslib.__generator(this, function (
|
|
6899
|
-
switch (
|
|
6904
|
+
return tslib.__generator(this, function (_b) {
|
|
6905
|
+
switch (_b.label) {
|
|
6900
6906
|
case 0:
|
|
6901
6907
|
mfaEnrollmentId = typeof infoOrUid === 'string' ? infoOrUid : infoOrUid.uid;
|
|
6902
6908
|
return [4 /*yield*/, this.user.getIdToken()];
|
|
6903
6909
|
case 1:
|
|
6904
|
-
idToken =
|
|
6910
|
+
idToken = _b.sent();
|
|
6905
6911
|
return [4 /*yield*/, _logoutIfInvalidated(this.user, withdrawMfa(this.user.auth, {
|
|
6906
6912
|
idToken: idToken,
|
|
6907
6913
|
mfaEnrollmentId: mfaEnrollmentId
|
|
6908
6914
|
}))];
|
|
6909
6915
|
case 2:
|
|
6910
|
-
idTokenResponse =
|
|
6916
|
+
idTokenResponse = _b.sent();
|
|
6911
6917
|
// Remove the second factor from the user's list.
|
|
6912
6918
|
this.enrolledFactors = this.enrolledFactors.filter(function (_a) {
|
|
6913
6919
|
var uid = _a.uid;
|
|
@@ -6923,17 +6929,17 @@ var MultiFactorUserImpl = /** @class */ (function () {
|
|
|
6923
6929
|
// the tokenResponse may be empty. If the tokens were not updated (and they
|
|
6924
6930
|
// are now invalid), reloading the user will discover this and invalidate
|
|
6925
6931
|
// the user's state accordingly.
|
|
6926
|
-
|
|
6927
|
-
|
|
6932
|
+
_b.sent();
|
|
6933
|
+
_b.label = 4;
|
|
6928
6934
|
case 4:
|
|
6929
|
-
|
|
6935
|
+
_b.trys.push([4, 6, , 7]);
|
|
6930
6936
|
return [4 /*yield*/, this.user.reload()];
|
|
6931
6937
|
case 5:
|
|
6932
|
-
|
|
6938
|
+
_b.sent();
|
|
6933
6939
|
return [3 /*break*/, 7];
|
|
6934
6940
|
case 6:
|
|
6935
|
-
e_1 =
|
|
6936
|
-
if (e_1.code !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
|
|
6941
|
+
e_1 = _b.sent();
|
|
6942
|
+
if (((_a = e_1) === null || _a === void 0 ? void 0 : _a.code) !== "auth/" + "user-token-expired" /* TOKEN_EXPIRED */) {
|
|
6937
6943
|
throw e_1;
|
|
6938
6944
|
}
|
|
6939
6945
|
return [3 /*break*/, 7];
|
|
@@ -6964,7 +6970,7 @@ function multiFactor(user) {
|
|
|
6964
6970
|
}
|
|
6965
6971
|
|
|
6966
6972
|
var name = "@firebase/auth";
|
|
6967
|
-
var version = "0.20.
|
|
6973
|
+
var version = "0.20.3-canary.8f826604e";
|
|
6968
6974
|
|
|
6969
6975
|
/**
|
|
6970
6976
|
* @license
|
|
@@ -8271,7 +8277,7 @@ var PhoneAuthProvider = /** @class */ (function () {
|
|
|
8271
8277
|
* auth.currentUser,
|
|
8272
8278
|
* PhoneAuthProvider.credential(verificationId, code));
|
|
8273
8279
|
* } catch (e) {
|
|
8274
|
-
* if (e
|
|
8280
|
+
* if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {
|
|
8275
8281
|
* const cred = PhoneAuthProvider.credentialFromError(e);
|
|
8276
8282
|
* await linkWithCredential(auth.currentUser, cred);
|
|
8277
8283
|
* }
|
|
@@ -8489,4 +8495,4 @@ exports.updateProfile = updateProfile;
|
|
|
8489
8495
|
exports.useDeviceLanguage = useDeviceLanguage;
|
|
8490
8496
|
exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
|
|
8491
8497
|
exports.verifyPasswordResetCode = verifyPasswordResetCode;
|
|
8492
|
-
//# sourceMappingURL=phone-
|
|
8498
|
+
//# sourceMappingURL=phone-7ee311f7.js.map
|