@firebase/auth 0.19.3 → 0.19.4
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 +8 -0
- package/dist/auth-public.d.ts +1 -2
- package/dist/auth.d.ts +2 -3
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +9 -3
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-1cde31c6.js → popup_redirect-958a9598.js} +82 -48
- package/dist/cordova/popup_redirect-958a9598.js.map +1 -0
- package/dist/cordova/src/api/index.d.ts +2 -1
- package/dist/cordova/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/cordova/src/model/auth.d.ts +1 -1
- package/dist/cordova/src/model/public_types.d.ts +1 -2
- package/dist/esm2017/{index-8593558d.js → index-839de510.js} +30 -16
- package/dist/esm2017/index-839de510.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/api/index.d.ts +2 -1
- package/dist/esm2017/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/esm2017/src/model/auth.d.ts +1 -1
- package/dist/esm2017/src/model/public_types.d.ts +1 -2
- package/dist/esm5/{index-4f7e1a18.js → index-26e00cb2.js} +89 -49
- package/dist/esm5/index-26e00cb2.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/api/index.d.ts +2 -1
- package/dist/esm5/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/esm5/src/model/auth.d.ts +1 -1
- package/dist/esm5/src/model/public_types.d.ts +1 -2
- package/dist/index.webworker.esm5.js +81 -47
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-057dcc31.js → index-fe696f9c.js} +82 -48
- package/dist/node/index-fe696f9c.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/src/api/index.d.ts +2 -1
- package/dist/node/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/node/src/model/auth.d.ts +1 -1
- package/dist/node/src/model/public_types.d.ts +1 -2
- package/dist/node-esm/{index-c327074d.js → index-62b96d71.js} +24 -15
- package/dist/node-esm/index-62b96d71.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/api/index.d.ts +2 -1
- package/dist/node-esm/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/node-esm/src/model/auth.d.ts +1 -1
- package/dist/node-esm/src/model/public_types.d.ts +1 -2
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +8 -2
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-4c7624c1.js → phone-1d904137.js} +82 -48
- package/dist/rn/phone-1d904137.js.map +1 -0
- package/dist/rn/src/api/index.d.ts +2 -1
- package/dist/rn/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/rn/src/model/auth.d.ts +1 -1
- package/dist/rn/src/model/public_types.d.ts +1 -2
- package/dist/src/api/index.d.ts +2 -1
- package/dist/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/src/model/auth.d.ts +1 -1
- package/dist/src/model/public_types.d.ts +1 -2
- package/package.json +4 -3
- package/dist/cordova/popup_redirect-1cde31c6.js.map +0 -1
- package/dist/esm2017/index-8593558d.js.map +0 -1
- package/dist/esm5/index-4f7e1a18.js.map +0 -1
- package/dist/node/index-057dcc31.js.map +0 -1
- package/dist/node-esm/index-c327074d.js.map +0 -1
- package/dist/rn/phone-4c7624c1.js.map +0 -1
package/dist/esm2017/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-
|
|
1
|
+
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-839de510.js';
|
|
2
2
|
import '@firebase/util';
|
|
3
3
|
import '@firebase/app';
|
|
4
4
|
import 'tslib';
|
package/dist/esm2017/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ao as _isIOS7Or8, ap as debugAssert, aq as _isIOS, ar as _isAndroid, as as _fail, at as _getRedirectUrl, au as _getProjectConfig, av as _createError, aw as _assert, ax as _getInstance, b as browserLocalPersistence, ay as _persistenceKeyName, az as AuthEventManager, a as browserSessionPersistence, aA as _getRedirectResult, aB as _clearRedirectOutcomes, aC as _castAuth } from './index-
|
|
2
|
-
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aE as AuthImpl, aH as AuthPopup, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aI as FetchProvider, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aJ as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aD as UserImpl, aw as _assert, aC as _castAuth, as as _fail, aG as _generateEventId, aF as _getClientVersion, ax as _getInstance, aA as _getRedirectResult, ay as _persistenceKeyName, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-
|
|
1
|
+
import { ao as _isIOS7Or8, ap as debugAssert, aq as _isIOS, ar as _isAndroid, as as _fail, at as _getRedirectUrl, au as _getProjectConfig, av as _createError, aw as _assert, ax as _getInstance, b as browserLocalPersistence, ay as _persistenceKeyName, az as AuthEventManager, a as browserSessionPersistence, aA as _getRedirectResult, aB as _clearRedirectOutcomes, aC as _castAuth } from './index-839de510.js';
|
|
2
|
+
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aE as AuthImpl, aH as AuthPopup, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aI as FetchProvider, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aJ as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aD as UserImpl, aw as _assert, aC as _castAuth, as as _fail, aG as _generateEventId, aF as _getClientVersion, ax as _getInstance, aA as _getRedirectResult, ay as _persistenceKeyName, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-839de510.js';
|
|
3
3
|
import { querystringDecode } from '@firebase/util';
|
|
4
4
|
import '@firebase/app';
|
|
5
5
|
import 'tslib';
|
|
@@ -27,7 +27,8 @@ export declare const enum HttpMethod {
|
|
|
27
27
|
export declare const enum HttpHeader {
|
|
28
28
|
CONTENT_TYPE = "Content-Type",
|
|
29
29
|
X_FIREBASE_LOCALE = "X-Firebase-Locale",
|
|
30
|
-
X_CLIENT_VERSION = "X-Client-Version"
|
|
30
|
+
X_CLIENT_VERSION = "X-Client-Version",
|
|
31
|
+
X_FIREBASE_GMPID = "X-Firebase-gmpid"
|
|
31
32
|
}
|
|
32
33
|
export declare const enum Endpoint {
|
|
33
34
|
CREATE_AUTH_URI = "/v1/accounts:createAuthUri",
|
|
@@ -95,7 +95,7 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
|
95
95
|
private clientVersion;
|
|
96
96
|
_logFramework(framework: string): void;
|
|
97
97
|
_getFrameworks(): readonly string[];
|
|
98
|
-
|
|
98
|
+
_getAdditionalHeaders(): Promise<Record<string, string>>;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Method to be used to cast down to our private implmentation of Auth.
|
|
@@ -63,7 +63,7 @@ export interface AuthInternal extends Auth {
|
|
|
63
63
|
_getPersistence(): string;
|
|
64
64
|
_logFramework(framework: string): void;
|
|
65
65
|
_getFrameworks(): readonly string[];
|
|
66
|
-
|
|
66
|
+
_getAdditionalHeaders(): Promise<Record<string, string>>;
|
|
67
67
|
readonly name: AppName;
|
|
68
68
|
readonly config: ConfigInternal;
|
|
69
69
|
languageCode: string | null;
|
|
@@ -934,8 +934,7 @@ export interface User extends UserInfo {
|
|
|
934
934
|
toJSON(): object;
|
|
935
935
|
}
|
|
936
936
|
/**
|
|
937
|
-
* A structure containing a {@link User},
|
|
938
|
-
* and any additional user information that was returned from the identity provider.
|
|
937
|
+
* A structure containing a {@link User}, the {@link OperationType}, and the provider ID.
|
|
939
938
|
*
|
|
940
939
|
* @remarks
|
|
941
940
|
* `operationType` could be {@link OperationType}.SIGN_IN for a sign-in operation,
|
|
@@ -941,30 +941,38 @@ function _addTidIfNecessary(auth, request) {
|
|
|
941
941
|
function _performApiRequest(auth, method, path, request, customErrorMap) {
|
|
942
942
|
if (customErrorMap === void 0) { customErrorMap = {}; }
|
|
943
943
|
return __awaiter(this, void 0, void 0, function () {
|
|
944
|
+
var _this = this;
|
|
944
945
|
return __generator(this, function (_a) {
|
|
945
|
-
return [2 /*return*/, _performFetchWithErrorHandling(auth, customErrorMap, function () {
|
|
946
|
-
var body
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
946
|
+
return [2 /*return*/, _performFetchWithErrorHandling(auth, customErrorMap, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
947
|
+
var body, params, query, headers;
|
|
948
|
+
return __generator(this, function (_a) {
|
|
949
|
+
switch (_a.label) {
|
|
950
|
+
case 0:
|
|
951
|
+
body = {};
|
|
952
|
+
params = {};
|
|
953
|
+
if (request) {
|
|
954
|
+
if (method === "GET" /* GET */) {
|
|
955
|
+
params = request;
|
|
956
|
+
}
|
|
957
|
+
else {
|
|
958
|
+
body = {
|
|
959
|
+
body: JSON.stringify(request)
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
query = querystring(__assign({ key: auth.config.apiKey }, params)).slice(1);
|
|
964
|
+
return [4 /*yield*/, auth._getAdditionalHeaders()];
|
|
965
|
+
case 1:
|
|
966
|
+
headers = _a.sent();
|
|
967
|
+
headers["Content-Type" /* CONTENT_TYPE */] = 'application/json';
|
|
968
|
+
if (auth.languageCode) {
|
|
969
|
+
headers["X-Firebase-Locale" /* X_FIREBASE_LOCALE */] = auth.languageCode;
|
|
970
|
+
}
|
|
971
|
+
return [2 /*return*/, FetchProvider.fetch()(_getFinalTarget(auth, auth.config.apiHost, path, query), __assign({ method: method,
|
|
972
|
+
headers: headers, referrerPolicy: 'no-referrer' }, body))];
|
|
956
973
|
}
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
var headers = new (FetchProvider.headers())();
|
|
960
|
-
headers.set("Content-Type" /* CONTENT_TYPE */, 'application/json');
|
|
961
|
-
headers.set("X-Client-Version" /* X_CLIENT_VERSION */, auth._getSdkClientVersion());
|
|
962
|
-
if (auth.languageCode) {
|
|
963
|
-
headers.set("X-Firebase-Locale" /* X_FIREBASE_LOCALE */, auth.languageCode);
|
|
964
|
-
}
|
|
965
|
-
return FetchProvider.fetch()(_getFinalTarget(auth, auth.config.apiHost, path, query), __assign({ method: method,
|
|
966
|
-
headers: headers, referrerPolicy: 'no-referrer' }, body));
|
|
967
|
-
})];
|
|
974
|
+
});
|
|
975
|
+
}); })];
|
|
968
976
|
});
|
|
969
977
|
});
|
|
970
978
|
}
|
|
@@ -1595,24 +1603,32 @@ function extractProviderData(providers) {
|
|
|
1595
1603
|
function requestStsToken(auth, refreshToken) {
|
|
1596
1604
|
return __awaiter(this, void 0, void 0, function () {
|
|
1597
1605
|
var response;
|
|
1606
|
+
var _this = this;
|
|
1598
1607
|
return __generator(this, function (_a) {
|
|
1599
1608
|
switch (_a.label) {
|
|
1600
|
-
case 0: return [4 /*yield*/, _performFetchWithErrorHandling(auth, {}, function () {
|
|
1601
|
-
var body
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1609
|
+
case 0: return [4 /*yield*/, _performFetchWithErrorHandling(auth, {}, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1610
|
+
var body, _a, tokenApiHost, apiKey, url, headers;
|
|
1611
|
+
return __generator(this, function (_b) {
|
|
1612
|
+
switch (_b.label) {
|
|
1613
|
+
case 0:
|
|
1614
|
+
body = querystring({
|
|
1615
|
+
'grant_type': 'refresh_token',
|
|
1616
|
+
'refresh_token': refreshToken
|
|
1617
|
+
}).slice(1);
|
|
1618
|
+
_a = auth.config, tokenApiHost = _a.tokenApiHost, apiKey = _a.apiKey;
|
|
1619
|
+
url = _getFinalTarget(auth, tokenApiHost, "/v1/token" /* TOKEN */, "key=" + apiKey);
|
|
1620
|
+
return [4 /*yield*/, auth._getAdditionalHeaders()];
|
|
1621
|
+
case 1:
|
|
1622
|
+
headers = _b.sent();
|
|
1623
|
+
headers["Content-Type" /* CONTENT_TYPE */] = 'application/x-www-form-urlencoded';
|
|
1624
|
+
return [2 /*return*/, FetchProvider.fetch()(url, {
|
|
1625
|
+
method: "POST" /* POST */,
|
|
1626
|
+
headers: headers,
|
|
1627
|
+
body: body
|
|
1628
|
+
})];
|
|
1629
|
+
}
|
|
1614
1630
|
});
|
|
1615
|
-
})];
|
|
1631
|
+
}); })];
|
|
1616
1632
|
case 1:
|
|
1617
1633
|
response = _a.sent();
|
|
1618
1634
|
// The response comes back in snake_case. Convert to camel:
|
|
@@ -2519,13 +2535,19 @@ var AuthImpl = /** @class */ (function () {
|
|
|
2519
2535
|
if (this._deleted) {
|
|
2520
2536
|
return [2 /*return*/];
|
|
2521
2537
|
}
|
|
2522
|
-
if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/,
|
|
2523
|
-
|
|
2538
|
+
if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/, 5];
|
|
2539
|
+
_d.label = 2;
|
|
2524
2540
|
case 2:
|
|
2541
|
+
_d.trys.push([2, 4, , 5]);
|
|
2542
|
+
return [4 /*yield*/, this._popupRedirectResolver._initialize(this)];
|
|
2543
|
+
case 3:
|
|
2525
2544
|
_d.sent();
|
|
2526
|
-
|
|
2527
|
-
case 3: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
|
|
2545
|
+
return [3 /*break*/, 5];
|
|
2528
2546
|
case 4:
|
|
2547
|
+
_d.sent();
|
|
2548
|
+
return [3 /*break*/, 5];
|
|
2549
|
+
case 5: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
|
|
2550
|
+
case 6:
|
|
2529
2551
|
_d.sent();
|
|
2530
2552
|
this.lastNotifiedUid = ((_c = this.currentUser) === null || _c === void 0 ? void 0 : _c.uid) || null;
|
|
2531
2553
|
if (this._deleted) {
|
|
@@ -2666,7 +2688,7 @@ var AuthImpl = /** @class */ (function () {
|
|
|
2666
2688
|
};
|
|
2667
2689
|
AuthImpl.prototype.reloadAndSetCurrentUserOrClear = function (user) {
|
|
2668
2690
|
return __awaiter(this, void 0, void 0, function () {
|
|
2669
|
-
var
|
|
2691
|
+
var e_3;
|
|
2670
2692
|
return __generator(this, function (_a) {
|
|
2671
2693
|
switch (_a.label) {
|
|
2672
2694
|
case 0:
|
|
@@ -2676,8 +2698,8 @@ var AuthImpl = /** @class */ (function () {
|
|
|
2676
2698
|
_a.sent();
|
|
2677
2699
|
return [3 /*break*/, 3];
|
|
2678
2700
|
case 2:
|
|
2679
|
-
|
|
2680
|
-
if (
|
|
2701
|
+
e_3 = _a.sent();
|
|
2702
|
+
if (e_3.code !== "auth/" + "network-request-failed" /* NETWORK_REQUEST_FAILED */) {
|
|
2681
2703
|
// Something's wrong with the user's token. Log them out and remove
|
|
2682
2704
|
// them from storage
|
|
2683
2705
|
return [2 /*return*/, this.directlySetCurrentUser(null)];
|
|
@@ -2986,8 +3008,20 @@ var AuthImpl = /** @class */ (function () {
|
|
|
2986
3008
|
AuthImpl.prototype._getFrameworks = function () {
|
|
2987
3009
|
return this.frameworks;
|
|
2988
3010
|
};
|
|
2989
|
-
AuthImpl.prototype.
|
|
2990
|
-
return this
|
|
3011
|
+
AuthImpl.prototype._getAdditionalHeaders = function () {
|
|
3012
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3013
|
+
var headers;
|
|
3014
|
+
var _a;
|
|
3015
|
+
return __generator(this, function (_b) {
|
|
3016
|
+
headers = (_a = {},
|
|
3017
|
+
_a["X-Client-Version" /* X_CLIENT_VERSION */] = this.clientVersion,
|
|
3018
|
+
_a);
|
|
3019
|
+
if (this.app.options.appId) {
|
|
3020
|
+
headers["X-Firebase-gmpid" /* X_FIREBASE_GMPID */] = this.app.options.appId;
|
|
3021
|
+
}
|
|
3022
|
+
return [2 /*return*/, headers];
|
|
3023
|
+
});
|
|
3024
|
+
});
|
|
2991
3025
|
};
|
|
2992
3026
|
return AuthImpl;
|
|
2993
3027
|
}());
|
|
@@ -10336,7 +10370,7 @@ function loadGapi(auth) {
|
|
|
10336
10370
|
}
|
|
10337
10371
|
};
|
|
10338
10372
|
// Load GApi loader.
|
|
10339
|
-
return _loadJS("https://apis.google.com/js/api.js?onload=" + cbName);
|
|
10373
|
+
return _loadJS("https://apis.google.com/js/api.js?onload=" + cbName).catch(function (e) { return reject(e); });
|
|
10340
10374
|
}
|
|
10341
10375
|
}).catch(function (error) {
|
|
10342
10376
|
// Reset cached promise to allow for retrial.
|
|
@@ -10684,6 +10718,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
10684
10718
|
});
|
|
10685
10719
|
};
|
|
10686
10720
|
BrowserPopupRedirectResolver.prototype._initialize = function (auth) {
|
|
10721
|
+
var _this = this;
|
|
10687
10722
|
var key = auth._key();
|
|
10688
10723
|
if (this.eventManagers[key]) {
|
|
10689
10724
|
var _a = this.eventManagers[key], manager = _a.manager, promise_1 = _a.promise;
|
|
@@ -10697,6 +10732,11 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
10697
10732
|
}
|
|
10698
10733
|
var promise = this.initAndGetManager(auth);
|
|
10699
10734
|
this.eventManagers[key] = { promise: promise };
|
|
10735
|
+
// If the promise is rejected, the key should be removed so that the
|
|
10736
|
+
// operation can be retried later.
|
|
10737
|
+
promise.catch(function () {
|
|
10738
|
+
delete _this.eventManagers[key];
|
|
10739
|
+
});
|
|
10700
10740
|
return promise;
|
|
10701
10741
|
};
|
|
10702
10742
|
BrowserPopupRedirectResolver.prototype.initAndGetManager = function (auth) {
|
|
@@ -10833,7 +10873,7 @@ var PhoneMultiFactorGenerator = /** @class */ (function () {
|
|
|
10833
10873
|
}());
|
|
10834
10874
|
|
|
10835
10875
|
var name = "@firebase/auth";
|
|
10836
|
-
var version = "0.19.
|
|
10876
|
+
var version = "0.19.4";
|
|
10837
10877
|
|
|
10838
10878
|
/**
|
|
10839
10879
|
* @license
|
|
@@ -11038,4 +11078,4 @@ function getAuth(app) {
|
|
|
11038
11078
|
registerAuth("Browser" /* BROWSER */);
|
|
11039
11079
|
|
|
11040
11080
|
export { sendPasswordResetEmail as $, ActionCodeOperation as A, prodErrorMap as B, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as C, initializeAuth as D, connectAuthEmulator as E, FactorId as F, AuthCredential as G, EmailAuthCredential as H, OAuthCredential as I, PhoneAuthCredential as J, inMemoryPersistence as K, EmailAuthProvider as L, FacebookAuthProvider as M, GoogleAuthProvider as N, OperationType as O, PhoneAuthProvider as P, GithubAuthProvider as Q, RecaptchaVerifier as R, SignInMethod as S, OAuthProvider as T, SAMLAuthProvider as U, TwitterAuthProvider as V, signInAnonymously as W, signInWithCredential as X, linkWithCredential as Y, reauthenticateWithCredential as Z, signInWithCustomToken as _, browserSessionPersistence as a, confirmPasswordReset as a0, applyActionCode as a1, checkActionCode as a2, verifyPasswordResetCode as a3, createUserWithEmailAndPassword as a4, signInWithEmailAndPassword as a5, sendSignInLinkToEmail as a6, isSignInWithEmailLink as a7, signInWithEmailLink as a8, fetchSignInMethodsForEmail as a9, _clearRedirectOutcomes as aA, _getRedirectResult as aB, _castAuth as aC, UserImpl as aD, AuthImpl as aE, _getClientVersion as aF, _generateEventId as aG, AuthPopup as aH, FetchProvider as aI, SAMLAuthCredential as aJ, sendEmailVerification as aa, verifyBeforeUpdateEmail as ab, ActionCodeURL as ac, parseActionCodeURL as ad, updateProfile as ae, updateEmail as af, updatePassword as ag, getIdToken as ah, getIdTokenResult as ai, unlink as aj, getAdditionalUserInfo as ak, reload as al, getMultiFactorResolver as am, multiFactor as an, _isAndroid as ao, _isIOS7Or8 as ap, _isIOS as aq, _fail as ar, _getRedirectUrl as as, debugAssert as at, _getProjectConfig as au, _createError as av, _assert as aw, AuthEventManager 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, onAuthStateChanged as t, updatePhoneNumber as u, useDeviceLanguage as v, updateCurrentUser as w, signOut as x, deleteUser as y, debugErrorMap as z };
|
|
11041
|
-
//# sourceMappingURL=index-
|
|
11081
|
+
//# sourceMappingURL=index-26e00cb2.js.map
|