@firebase/auth 0.20.11 → 0.21.0
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 +15 -0
- package/dist/cordova/index.js +3 -3
- package/dist/cordova/index.js.map +1 -1
- package/dist/cordova/internal.js +62 -63
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-41041153.js → popup_redirect-b7568081.js} +508 -516
- package/dist/cordova/{popup_redirect-41041153.js.map → popup_redirect-b7568081.js.map} +1 -1
- package/dist/esm2017/{index-0bb4da3b.js → index-c6def6da.js} +477 -484
- package/dist/esm2017/{index-0bb4da3b.js.map → index-c6def6da.js.map} +1 -1
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +15 -15
- package/dist/esm2017/internal.js.map +1 -1
- package/dist/esm5/{index-697aab8a.js → index-ef8e1de2.js} +554 -563
- package/dist/esm5/{index-697aab8a.js.map → index-ef8e1de2.js.map} +1 -1
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +16 -16
- package/dist/esm5/internal.js.map +1 -1
- package/dist/index.webworker.esm5.js +455 -463
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-a6537a51.js → index-2efb81c0.js} +438 -446
- package/dist/node/{index-a6537a51.js.map → index-2efb81c0.js.map} +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +46 -46
- package/dist/node/internal.js.map +1 -1
- package/dist/node-esm/{index-3246d34e.js → index-e0bc98c8.js} +374 -381
- package/dist/node-esm/{index-3246d34e.js.map → index-e0bc98c8.js.map} +1 -1
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +44 -44
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/rn/index.js +3 -3
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/internal.js +97 -98
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-5340e476.js → phone-bc99e0b0.js} +472 -480
- package/dist/rn/{phone-5340e476.js.map → phone-bc99e0b0.js.map} +1 -1
- package/package.json +8 -8
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-e0bc98c8.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 _isIOS, aE as _isAndroid, aF as _isIOS7Or8, aG as _createError, aH as _isIframe, aI as _isMobileBrowser, aJ as _isIE10, aK as _isSafari } 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 _isIOS, aE as _isAndroid, aF as _isIOS7Or8, aG as _createError, aH as _isIframe, aI as _isMobileBrowser, aJ as _isIE10, aK as _isSafari } from './index-e0bc98c8.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-e0bc98c8.js';
|
|
3
3
|
import { isEmpty, querystring, getUA, querystringDecode } from '@firebase/util';
|
|
4
4
|
import 'tslib';
|
|
5
5
|
import { SDK_VERSION } from '@firebase/app';
|
|
@@ -87,7 +87,7 @@ function _withDefaultResolver(auth, resolverOverride) {
|
|
|
87
87
|
if (resolverOverride) {
|
|
88
88
|
return _getInstance(resolverOverride);
|
|
89
89
|
}
|
|
90
|
-
_assert(auth._popupRedirectResolver, auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
90
|
+
_assert(auth._popupRedirectResolver, auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
91
91
|
return auth._popupRedirectResolver;
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -109,7 +109,7 @@ function _withDefaultResolver(auth, resolverOverride) {
|
|
|
109
109
|
*/
|
|
110
110
|
class IdpCredential extends AuthCredential {
|
|
111
111
|
constructor(params) {
|
|
112
|
-
super("custom" /* CUSTOM */, "custom" /* CUSTOM */);
|
|
112
|
+
super("custom" /* ProviderId.CUSTOM */, "custom" /* ProviderId.CUSTOM */);
|
|
113
113
|
this.params = params;
|
|
114
114
|
}
|
|
115
115
|
_getIdTokenResponse(auth) {
|
|
@@ -142,12 +142,12 @@ function _signIn(params) {
|
|
|
142
142
|
}
|
|
143
143
|
function _reauth(params) {
|
|
144
144
|
const { auth, user } = params;
|
|
145
|
-
_assert(user, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
145
|
+
_assert(user, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
146
146
|
return _reauthenticate(user, new IdpCredential(params), params.bypassAuthState);
|
|
147
147
|
}
|
|
148
148
|
async function _link(params) {
|
|
149
149
|
const { auth, user } = params;
|
|
150
|
-
_assert(user, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
150
|
+
_assert(user, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
151
151
|
return _link$1(user, new IdpCredential(params), params.bypassAuthState);
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -221,17 +221,17 @@ class AbstractPopupRedirectOperation {
|
|
|
221
221
|
}
|
|
222
222
|
getIdpTask(type) {
|
|
223
223
|
switch (type) {
|
|
224
|
-
case "signInViaPopup" /* SIGN_IN_VIA_POPUP */:
|
|
225
|
-
case "signInViaRedirect" /* SIGN_IN_VIA_REDIRECT */:
|
|
224
|
+
case "signInViaPopup" /* AuthEventType.SIGN_IN_VIA_POPUP */:
|
|
225
|
+
case "signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */:
|
|
226
226
|
return _signIn;
|
|
227
|
-
case "linkViaPopup" /* LINK_VIA_POPUP */:
|
|
228
|
-
case "linkViaRedirect" /* LINK_VIA_REDIRECT */:
|
|
227
|
+
case "linkViaPopup" /* AuthEventType.LINK_VIA_POPUP */:
|
|
228
|
+
case "linkViaRedirect" /* AuthEventType.LINK_VIA_REDIRECT */:
|
|
229
229
|
return _link;
|
|
230
|
-
case "reauthViaPopup" /* REAUTH_VIA_POPUP */:
|
|
231
|
-
case "reauthViaRedirect" /* REAUTH_VIA_REDIRECT */:
|
|
230
|
+
case "reauthViaPopup" /* AuthEventType.REAUTH_VIA_POPUP */:
|
|
231
|
+
case "reauthViaRedirect" /* AuthEventType.REAUTH_VIA_REDIRECT */:
|
|
232
232
|
return _reauth;
|
|
233
233
|
default:
|
|
234
|
-
_fail(this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
234
|
+
_fail(this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
resolve(cred) {
|
|
@@ -276,10 +276,10 @@ const redirectOutcomeMap = new Map();
|
|
|
276
276
|
class RedirectAction extends AbstractPopupRedirectOperation {
|
|
277
277
|
constructor(auth, resolver, bypassAuthState = false) {
|
|
278
278
|
super(auth, [
|
|
279
|
-
"signInViaRedirect" /* SIGN_IN_VIA_REDIRECT */,
|
|
280
|
-
"linkViaRedirect" /* LINK_VIA_REDIRECT */,
|
|
281
|
-
"reauthViaRedirect" /* REAUTH_VIA_REDIRECT */,
|
|
282
|
-
"unknown" /* UNKNOWN */
|
|
279
|
+
"signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */,
|
|
280
|
+
"linkViaRedirect" /* AuthEventType.LINK_VIA_REDIRECT */,
|
|
281
|
+
"reauthViaRedirect" /* AuthEventType.REAUTH_VIA_REDIRECT */,
|
|
282
|
+
"unknown" /* AuthEventType.UNKNOWN */
|
|
283
283
|
], resolver, undefined, bypassAuthState);
|
|
284
284
|
this.eventId = null;
|
|
285
285
|
}
|
|
@@ -308,10 +308,10 @@ class RedirectAction extends AbstractPopupRedirectOperation {
|
|
|
308
308
|
return readyOutcome();
|
|
309
309
|
}
|
|
310
310
|
async onAuthEvent(event) {
|
|
311
|
-
if (event.type === "signInViaRedirect" /* SIGN_IN_VIA_REDIRECT */) {
|
|
311
|
+
if (event.type === "signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */) {
|
|
312
312
|
return super.onAuthEvent(event);
|
|
313
313
|
}
|
|
314
|
-
else if (event.type === "unknown" /* UNKNOWN */) {
|
|
314
|
+
else if (event.type === "unknown" /* AuthEventType.UNKNOWN */) {
|
|
315
315
|
// This is a sentinel value indicating there's no pending redirect
|
|
316
316
|
this.resolve(null);
|
|
317
317
|
return;
|
|
@@ -456,7 +456,7 @@ class BrowserPersistenceClass {
|
|
|
456
456
|
*/
|
|
457
457
|
class BrowserSessionPersistence extends BrowserPersistenceClass {
|
|
458
458
|
constructor() {
|
|
459
|
-
super(() => window.sessionStorage, "SESSION" /* SESSION */);
|
|
459
|
+
super(() => window.sessionStorage, "SESSION" /* PersistenceType.SESSION */);
|
|
460
460
|
}
|
|
461
461
|
_addListener(_key, _listener) {
|
|
462
462
|
// Listeners are not supported for session storage since it cannot be shared across windows
|
|
@@ -505,8 +505,8 @@ const WIDGET_PATH = '__/auth/handler';
|
|
|
505
505
|
*/
|
|
506
506
|
const EMULATOR_WIDGET_PATH = 'emulator/auth/handler';
|
|
507
507
|
function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additionalParams) {
|
|
508
|
-
_assert(auth.config.authDomain, auth, "auth-domain-config-required" /* MISSING_AUTH_DOMAIN */);
|
|
509
|
-
_assert(auth.config.apiKey, auth, "invalid-api-key" /* INVALID_API_KEY */);
|
|
508
|
+
_assert(auth.config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */);
|
|
509
|
+
_assert(auth.config.apiKey, auth, "invalid-api-key" /* AuthErrorCode.INVALID_API_KEY */);
|
|
510
510
|
const params = {
|
|
511
511
|
apiKey: auth.config.apiKey,
|
|
512
512
|
appName: auth.name,
|
|
@@ -589,7 +589,7 @@ function _cordovaWindow() {
|
|
|
589
589
|
* limitations under the License.
|
|
590
590
|
*/
|
|
591
591
|
async function _getProjectConfig(auth, request = {}) {
|
|
592
|
-
return _performApiRequest(auth, "GET" /* GET */, "/v1/projects" /* GET_PROJECT_CONFIG */, request);
|
|
592
|
+
return _performApiRequest(auth, "GET" /* HttpMethod.GET */, "/v1/projects" /* Endpoint.GET_PROJECT_CONFIG */, request);
|
|
593
593
|
}
|
|
594
594
|
|
|
595
595
|
/**
|
|
@@ -632,7 +632,7 @@ async function _generateHandlerUrl(auth, event, provider) {
|
|
|
632
632
|
additionalParams['apn'] = BuildInfo.packageName;
|
|
633
633
|
}
|
|
634
634
|
else {
|
|
635
|
-
_fail(auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
635
|
+
_fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
|
|
636
636
|
}
|
|
637
637
|
// Add the display name if available
|
|
638
638
|
if (BuildInfo.displayName) {
|
|
@@ -655,7 +655,7 @@ async function _validateOrigin(auth) {
|
|
|
655
655
|
request.androidPackageName = BuildInfo.packageName;
|
|
656
656
|
}
|
|
657
657
|
else {
|
|
658
|
-
_fail(auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
658
|
+
_fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
|
|
659
659
|
}
|
|
660
660
|
// Will fail automatically if package name is not authorized
|
|
661
661
|
await _getProjectConfig(auth, request);
|
|
@@ -713,7 +713,7 @@ async function _waitForAppResume(auth, eventListener, iabRef) {
|
|
|
713
713
|
}
|
|
714
714
|
onCloseTimer = window.setTimeout(() => {
|
|
715
715
|
// Wait two seeconds after resume then reject.
|
|
716
|
-
reject(_createError(auth, "redirect-cancelled-by-user" /* REDIRECT_CANCELLED_BY_USER */));
|
|
716
|
+
reject(_createError(auth, "redirect-cancelled-by-user" /* AuthErrorCode.REDIRECT_CANCELLED_BY_USER */));
|
|
717
717
|
}, REDIRECT_TIMEOUT_MS);
|
|
718
718
|
}
|
|
719
719
|
function visibilityChanged() {
|
|
@@ -757,22 +757,22 @@ function _checkCordovaConfiguration(auth) {
|
|
|
757
757
|
// Note that cordova-universal-links-plugin has been abandoned.
|
|
758
758
|
// A fork with latest fixes is available at:
|
|
759
759
|
// https://www.npmjs.com/package/cordova-universal-links-plugin-fix
|
|
760
|
-
_assert(typeof ((_a = win === null || win === void 0 ? void 0 : win.universalLinks) === null || _a === void 0 ? void 0 : _a.subscribe) === 'function', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
760
|
+
_assert(typeof ((_a = win === null || win === void 0 ? void 0 : win.universalLinks) === null || _a === void 0 ? void 0 : _a.subscribe) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
761
761
|
missingPlugin: 'cordova-universal-links-plugin-fix'
|
|
762
762
|
});
|
|
763
763
|
// https://www.npmjs.com/package/cordova-plugin-buildinfo
|
|
764
|
-
_assert(typeof ((_b = win === null || win === void 0 ? void 0 : win.BuildInfo) === null || _b === void 0 ? void 0 : _b.packageName) !== 'undefined', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
764
|
+
_assert(typeof ((_b = win === null || win === void 0 ? void 0 : win.BuildInfo) === null || _b === void 0 ? void 0 : _b.packageName) !== 'undefined', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
765
765
|
missingPlugin: 'cordova-plugin-buildInfo'
|
|
766
766
|
});
|
|
767
767
|
// https://github.com/google/cordova-plugin-browsertab
|
|
768
|
-
_assert(typeof ((_e = (_d = (_c = win === null || win === void 0 ? void 0 : win.cordova) === null || _c === void 0 ? void 0 : _c.plugins) === null || _d === void 0 ? void 0 : _d.browsertab) === null || _e === void 0 ? void 0 : _e.openUrl) === 'function', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
768
|
+
_assert(typeof ((_e = (_d = (_c = win === null || win === void 0 ? void 0 : win.cordova) === null || _c === void 0 ? void 0 : _c.plugins) === null || _d === void 0 ? void 0 : _d.browsertab) === null || _e === void 0 ? void 0 : _e.openUrl) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
769
769
|
missingPlugin: 'cordova-plugin-browsertab'
|
|
770
770
|
});
|
|
771
|
-
_assert(typeof ((_h = (_g = (_f = win === null || win === void 0 ? void 0 : win.cordova) === null || _f === void 0 ? void 0 : _f.plugins) === null || _g === void 0 ? void 0 : _g.browsertab) === null || _h === void 0 ? void 0 : _h.isAvailable) === 'function', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
771
|
+
_assert(typeof ((_h = (_g = (_f = win === null || win === void 0 ? void 0 : win.cordova) === null || _f === void 0 ? void 0 : _f.plugins) === null || _g === void 0 ? void 0 : _g.browsertab) === null || _h === void 0 ? void 0 : _h.isAvailable) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
772
772
|
missingPlugin: 'cordova-plugin-browsertab'
|
|
773
773
|
});
|
|
774
774
|
// https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/
|
|
775
|
-
_assert(typeof ((_k = (_j = win === null || win === void 0 ? void 0 : win.cordova) === null || _j === void 0 ? void 0 : _j.InAppBrowser) === null || _k === void 0 ? void 0 : _k.open) === 'function', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
775
|
+
_assert(typeof ((_k = (_j = win === null || win === void 0 ? void 0 : win.cordova) === null || _j === void 0 ? void 0 : _j.InAppBrowser) === null || _k === void 0 ? void 0 : _k.open) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
776
776
|
missingPlugin: 'cordova-plugin-inappbrowser'
|
|
777
777
|
});
|
|
778
778
|
}
|
|
@@ -876,7 +876,7 @@ class AuthEventManager {
|
|
|
876
876
|
var _a;
|
|
877
877
|
if (event.error && !isNullRedirectEvent(event)) {
|
|
878
878
|
const code = ((_a = event.error.code) === null || _a === void 0 ? void 0 : _a.split('auth/')[1]) ||
|
|
879
|
-
"internal-error" /* INTERNAL_ERROR */;
|
|
879
|
+
"internal-error" /* AuthErrorCode.INTERNAL_ERROR */;
|
|
880
880
|
consumer.onError(_createError(this.auth, code));
|
|
881
881
|
}
|
|
882
882
|
else {
|
|
@@ -904,16 +904,16 @@ function eventUid(e) {
|
|
|
904
904
|
return [e.type, e.eventId, e.sessionId, e.tenantId].filter(v => v).join('-');
|
|
905
905
|
}
|
|
906
906
|
function isNullRedirectEvent({ type, error }) {
|
|
907
|
-
return (type === "unknown" /* UNKNOWN */ &&
|
|
908
|
-
(error === null || error === void 0 ? void 0 : error.code) === `auth/${"no-auth-event" /* NO_AUTH_EVENT */}`);
|
|
907
|
+
return (type === "unknown" /* AuthEventType.UNKNOWN */ &&
|
|
908
|
+
(error === null || error === void 0 ? void 0 : error.code) === `auth/${"no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */}`);
|
|
909
909
|
}
|
|
910
910
|
function isRedirectEvent(event) {
|
|
911
911
|
switch (event.type) {
|
|
912
|
-
case "signInViaRedirect" /* SIGN_IN_VIA_REDIRECT */:
|
|
913
|
-
case "linkViaRedirect" /* LINK_VIA_REDIRECT */:
|
|
914
|
-
case "reauthViaRedirect" /* REAUTH_VIA_REDIRECT */:
|
|
912
|
+
case "signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */:
|
|
913
|
+
case "linkViaRedirect" /* AuthEventType.LINK_VIA_REDIRECT */:
|
|
914
|
+
case "reauthViaRedirect" /* AuthEventType.REAUTH_VIA_REDIRECT */:
|
|
915
915
|
return true;
|
|
916
|
-
case "unknown" /* UNKNOWN */:
|
|
916
|
+
case "unknown" /* AuthEventType.UNKNOWN */:
|
|
917
917
|
return isNullRedirectEvent(event);
|
|
918
918
|
default:
|
|
919
919
|
return false;
|
|
@@ -946,7 +946,7 @@ const _POLLING_INTERVAL_MS = 1000;
|
|
|
946
946
|
const IE10_LOCAL_STORAGE_SYNC_DELAY = 10;
|
|
947
947
|
class BrowserLocalPersistence extends BrowserPersistenceClass {
|
|
948
948
|
constructor() {
|
|
949
|
-
super(() => window.localStorage, "LOCAL" /* LOCAL */);
|
|
949
|
+
super(() => window.localStorage, "LOCAL" /* PersistenceType.LOCAL */);
|
|
950
950
|
this.boundEventHandler = (event, poll) => this.onStorageEvent(event, poll);
|
|
951
951
|
this.listeners = {};
|
|
952
952
|
this.localCache = {};
|
|
@@ -1188,7 +1188,7 @@ function _generateNewEvent(auth, type, eventId = null) {
|
|
|
1188
1188
|
sessionId: generateSessionId(),
|
|
1189
1189
|
postBody: null,
|
|
1190
1190
|
tenantId: auth.tenantId,
|
|
1191
|
-
error: _createError(auth, "no-auth-event" /* NO_AUTH_EVENT */)
|
|
1191
|
+
error: _createError(auth, "no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */)
|
|
1192
1192
|
};
|
|
1193
1193
|
}
|
|
1194
1194
|
function _savePartialEvent(auth, event) {
|
|
@@ -1258,7 +1258,7 @@ function storage() {
|
|
|
1258
1258
|
return _getInstance(browserLocalPersistence);
|
|
1259
1259
|
}
|
|
1260
1260
|
function persistenceKey(auth) {
|
|
1261
|
-
return _persistenceKeyName("authEvent" /* AUTH_EVENT */, auth.config.apiKey, auth.name);
|
|
1261
|
+
return _persistenceKeyName("authEvent" /* KeyName.AUTH_EVENT */, auth.config.apiKey, auth.name);
|
|
1262
1262
|
}
|
|
1263
1263
|
function parseJsonOrNull(json) {
|
|
1264
1264
|
try {
|
|
@@ -1334,7 +1334,7 @@ class CordovaPopupRedirectResolver {
|
|
|
1334
1334
|
return manager;
|
|
1335
1335
|
}
|
|
1336
1336
|
_openPopup(auth) {
|
|
1337
|
-
_fail(auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
1337
|
+
_fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
|
|
1338
1338
|
}
|
|
1339
1339
|
async _openRedirect(auth, provider, authType, eventId) {
|
|
1340
1340
|
_checkCordovaConfiguration(auth);
|
|
@@ -1422,13 +1422,13 @@ class CordovaPopupRedirectResolver {
|
|
|
1422
1422
|
const cordovaPopupRedirectResolver = CordovaPopupRedirectResolver;
|
|
1423
1423
|
function generateNoEvent() {
|
|
1424
1424
|
return {
|
|
1425
|
-
type: "unknown" /* UNKNOWN */,
|
|
1425
|
+
type: "unknown" /* AuthEventType.UNKNOWN */,
|
|
1426
1426
|
eventId: null,
|
|
1427
1427
|
sessionId: null,
|
|
1428
1428
|
urlResponse: null,
|
|
1429
1429
|
postBody: null,
|
|
1430
1430
|
tenantId: null,
|
|
1431
|
-
error: _createError("no-auth-event" /* NO_AUTH_EVENT */)
|
|
1431
|
+
error: _createError("no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */)
|
|
1432
1432
|
};
|
|
1433
1433
|
}
|
|
1434
1434
|
|