@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @firebase/auth
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`1625f7a95`](https://github.com/firebase/firebase-js-sdk/commit/1625f7a95cc3ffb666845db0a8044329be74b5be) [#6799](https://github.com/firebase/firebase-js-sdk/pull/6799) - Update TypeScript version to 4.7.4.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`e650f6498`](https://github.com/firebase/firebase-js-sdk/commit/e650f649854f3c39737fe4bade43f9eedc3e611f) [#6762](https://github.com/firebase/firebase-js-sdk/pull/6762) (fixes [#6736](https://github.com/firebase/firebase-js-sdk/issues/6736)) - move selenium-webdriver to devDependencies
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`c20633ed3`](https://github.com/firebase/firebase-js-sdk/commit/c20633ed35056cbadc9d65d9ceddf4e28d1ea666), [`1625f7a95`](https://github.com/firebase/firebase-js-sdk/commit/1625f7a95cc3ffb666845db0a8044329be74b5be)]:
|
|
14
|
+
- @firebase/util@1.8.0
|
|
15
|
+
- @firebase/component@0.6.0
|
|
16
|
+
- @firebase/logger@0.4.0
|
|
17
|
+
|
|
3
18
|
## 0.20.11
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cordova/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getApp, _getProvider } from '@firebase/app';
|
|
2
|
-
import { _ as _signInWithRedirect, a as _reauthenticateWithRedirect, b as _linkWithRedirect, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, d as cordovaPopupRedirectResolver } from './popup_redirect-
|
|
3
|
-
export { A as ActionCodeOperation, a3 as ActionCodeURL, v as AuthCredential, q as AuthErrorCodes, E as EmailAuthCredential, z as EmailAuthProvider, B as FacebookAuthProvider, F as FactorId, C as GithubAuthProvider, G as GoogleAuthProvider, w as OAuthCredential, D as OAuthProvider, O as OperationType, x as PhoneAuthCredential, P as ProviderId, H as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, R as applyActionCode, h as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, U as checkActionCode, Q as confirmPasswordReset, t as connectAuthEmulator, d as cordovaPopupRedirectResolver, W as createUserWithEmailAndPassword, n as debugErrorMap, m as deleteUser, a0 as fetchSignInMethodsForEmail, ab as getAdditionalUserInfo, a8 as getIdToken, a9 as getIdTokenResult, ad as getMultiFactorResolver, g as getRedirectResult, y as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, Z as isSignInWithEmailLink, K as linkWithCredential, ae as multiFactor, j as onAuthStateChanged, o as onIdTokenChanged, a4 as parseActionCodeURL, p as prodErrorMap, L as reauthenticateWithCredential, ac as reload, a1 as sendEmailVerification, N as sendPasswordResetEmail, Y as sendSignInLinkToEmail, s as setPersistence, I as signInAnonymously, J as signInWithCredential, M as signInWithCustomToken, X as signInWithEmailAndPassword, $ as signInWithEmailLink, l as signOut, aa as unlink, k as updateCurrentUser, a6 as updateEmail, a7 as updatePassword, a5 as updateProfile, u as useDeviceLanguage, a2 as verifyBeforeUpdateEmail, V as verifyPasswordResetCode } from './popup_redirect-
|
|
2
|
+
import { _ as _signInWithRedirect, a as _reauthenticateWithRedirect, b as _linkWithRedirect, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, d as cordovaPopupRedirectResolver } from './popup_redirect-b7568081.js';
|
|
3
|
+
export { A as ActionCodeOperation, a3 as ActionCodeURL, v as AuthCredential, q as AuthErrorCodes, E as EmailAuthCredential, z as EmailAuthProvider, B as FacebookAuthProvider, F as FactorId, C as GithubAuthProvider, G as GoogleAuthProvider, w as OAuthCredential, D as OAuthProvider, O as OperationType, x as PhoneAuthCredential, P as ProviderId, H as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, R as applyActionCode, h as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, U as checkActionCode, Q as confirmPasswordReset, t as connectAuthEmulator, d as cordovaPopupRedirectResolver, W as createUserWithEmailAndPassword, n as debugErrorMap, m as deleteUser, a0 as fetchSignInMethodsForEmail, ab as getAdditionalUserInfo, a8 as getIdToken, a9 as getIdTokenResult, ad as getMultiFactorResolver, g as getRedirectResult, y as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, Z as isSignInWithEmailLink, K as linkWithCredential, ae as multiFactor, j as onAuthStateChanged, o as onIdTokenChanged, a4 as parseActionCodeURL, p as prodErrorMap, L as reauthenticateWithCredential, ac as reload, a1 as sendEmailVerification, N as sendPasswordResetEmail, Y as sendSignInLinkToEmail, s as setPersistence, I as signInAnonymously, J as signInWithCredential, M as signInWithCustomToken, X as signInWithEmailAndPassword, $ as signInWithEmailLink, l as signOut, aa as unlink, k as updateCurrentUser, a6 as updateEmail, a7 as updatePassword, a5 as updateProfile, u as useDeviceLanguage, a2 as verifyBeforeUpdateEmail, V as verifyPasswordResetCode } from './popup_redirect-b7568081.js';
|
|
4
4
|
import 'tslib';
|
|
5
5
|
import '@firebase/util';
|
|
6
6
|
import '@firebase/component';
|
|
@@ -59,7 +59,7 @@ function getAuth(app) {
|
|
|
59
59
|
popupRedirectResolver: cordovaPopupRedirectResolver
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
registerAuth("Cordova" /* CORDOVA */);
|
|
62
|
+
registerAuth("Cordova" /* ClientPlatform.CORDOVA */);
|
|
63
63
|
|
|
64
64
|
export { getAuth, linkWithRedirect, reauthenticateWithRedirect, signInWithRedirect };
|
|
65
65
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/platform_cordova/strategies/redirect.ts","../../index.cordova.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Auth,\n AuthProvider,\n PopupRedirectResolver,\n User\n} from '../../model/public_types';\nimport {\n _linkWithRedirect,\n _reauthenticateWithRedirect,\n _signInWithRedirect\n} from '../../platform_browser/strategies/redirect';\n\nexport function signInWithRedirect(\n auth: Auth,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise<void> {\n return _signInWithRedirect(auth, provider, resolver) as Promise<void>;\n}\n\nexport function reauthenticateWithRedirect(\n user: User,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise<void> {\n return _reauthenticateWithRedirect(user, provider, resolver) as Promise<void>;\n}\n\nexport function linkWithRedirect(\n user: User,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise<void> {\n return _linkWithRedirect(user, provider, resolver) as Promise<void>;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This is the file that people using Cordova will actually import. You\n * should only include this file if you have something specific about your\n * implementation that mandates having a separate entrypoint. Otherwise you can\n * just use index.ts\n */\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\nimport { Auth } from './src/model/public_types';\nimport { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db';\n\nimport { initializeAuth } from './src';\nimport { registerAuth } from './src/core/auth/register';\nimport { ClientPlatform } from './src/core/util/version';\n\nexport * from './index.shared';\n\n// Cordova also supports indexedDB / browserSession / browserLocal\nexport { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db';\nexport { browserLocalPersistence } from './src/platform_browser/persistence/local_storage';\nexport { browserSessionPersistence } from './src/platform_browser/persistence/session_storage';\nexport { getRedirectResult } from './src/platform_browser/strategies/redirect';\n\nexport { cordovaPopupRedirectResolver } from './src/platform_cordova/popup_redirect/popup_redirect';\nexport {\n signInWithRedirect,\n reauthenticateWithRedirect,\n linkWithRedirect\n} from './src/platform_cordova/strategies/redirect';\n\nimport { cordovaPopupRedirectResolver } from './src/platform_cordova/popup_redirect/popup_redirect';\n\nexport function getAuth(app: FirebaseApp = getApp()): Auth {\n const provider = _getProvider(app, 'auth');\n\n if (provider.isInitialized()) {\n return provider.getImmediate();\n }\n\n return initializeAuth(app, {\n persistence: indexedDBLocalPersistence,\n popupRedirectResolver: cordovaPopupRedirectResolver\n });\n}\n\nregisterAuth(ClientPlatform.CORDOVA);\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;SAca,kBAAkB,CAChC,IAAU,EACV,QAAsB,EACtB,QAAgC,EAAA;IAEhC,OAAO,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAkB,CAAC;AACxE,CAAC;SAEe,0BAA0B,CACxC,IAAU,EACV,QAAsB,EACtB,QAAgC,EAAA;IAEhC,OAAO,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAkB,CAAC;AAChF,CAAC;SAEe,gBAAgB,CAC9B,IAAU,EACV,QAAsB,EACtB,QAAgC,EAAA;IAEhC,OAAO,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAkB,CAAC;AACtE;;ACnDA;;;;;;;;;;;;;;;AAeG;AAkCG,SAAU,OAAO,CAAC,GAA2B,EAAA;IAA3B,IAAA,GAAA,KAAA,KAAA,CAAA,EAAA,EAAA,GAAmB,GAAA,MAAM,EAAE,CAAA,EAAA;IACjD,IAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAE3C,IAAA,IAAI,QAAQ,CAAC,aAAa,EAAE,EAAE;AAC5B,QAAA,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;AAChC,KAAA;IAED,OAAO,cAAc,CAAC,GAAG,EAAE;AACzB,QAAA,WAAW,EAAE,yBAAyB;AACtC,QAAA,qBAAqB,EAAE,4BAA4B;AACpD,KAAA,CAAC,CAAC;AACL,CAAC;AAED,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/platform_cordova/strategies/redirect.ts","../../index.cordova.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Auth,\n AuthProvider,\n PopupRedirectResolver,\n User\n} from '../../model/public_types';\nimport {\n _linkWithRedirect,\n _reauthenticateWithRedirect,\n _signInWithRedirect\n} from '../../platform_browser/strategies/redirect';\n\nexport function signInWithRedirect(\n auth: Auth,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise<void> {\n return _signInWithRedirect(auth, provider, resolver) as Promise<void>;\n}\n\nexport function reauthenticateWithRedirect(\n user: User,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise<void> {\n return _reauthenticateWithRedirect(user, provider, resolver) as Promise<void>;\n}\n\nexport function linkWithRedirect(\n user: User,\n provider: AuthProvider,\n resolver?: PopupRedirectResolver\n): Promise<void> {\n return _linkWithRedirect(user, provider, resolver) as Promise<void>;\n}\n","/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This is the file that people using Cordova will actually import. You\n * should only include this file if you have something specific about your\n * implementation that mandates having a separate entrypoint. Otherwise you can\n * just use index.ts\n */\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\nimport { Auth } from './src/model/public_types';\nimport { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db';\n\nimport { initializeAuth } from './src';\nimport { registerAuth } from './src/core/auth/register';\nimport { ClientPlatform } from './src/core/util/version';\n\nexport * from './index.shared';\n\n// Cordova also supports indexedDB / browserSession / browserLocal\nexport { indexedDBLocalPersistence } from './src/platform_browser/persistence/indexed_db';\nexport { browserLocalPersistence } from './src/platform_browser/persistence/local_storage';\nexport { browserSessionPersistence } from './src/platform_browser/persistence/session_storage';\nexport { getRedirectResult } from './src/platform_browser/strategies/redirect';\n\nexport { cordovaPopupRedirectResolver } from './src/platform_cordova/popup_redirect/popup_redirect';\nexport {\n signInWithRedirect,\n reauthenticateWithRedirect,\n linkWithRedirect\n} from './src/platform_cordova/strategies/redirect';\n\nimport { cordovaPopupRedirectResolver } from './src/platform_cordova/popup_redirect/popup_redirect';\n\nexport function getAuth(app: FirebaseApp = getApp()): Auth {\n const provider = _getProvider(app, 'auth');\n\n if (provider.isInitialized()) {\n return provider.getImmediate();\n }\n\n return initializeAuth(app, {\n persistence: indexedDBLocalPersistence,\n popupRedirectResolver: cordovaPopupRedirectResolver\n });\n}\n\nregisterAuth(ClientPlatform.CORDOVA);\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;SAca,kBAAkB,CAChC,IAAU,EACV,QAAsB,EACtB,QAAgC,EAAA;IAEhC,OAAO,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAkB,CAAC;AACxE,CAAC;SAEe,0BAA0B,CACxC,IAAU,EACV,QAAsB,EACtB,QAAgC,EAAA;IAEhC,OAAO,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAkB,CAAC;AAChF,CAAC;SAEe,gBAAgB,CAC9B,IAAU,EACV,QAAsB,EACtB,QAAgC,EAAA;IAEhC,OAAO,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAkB,CAAC;AACtE;;ACnDA;;;;;;;;;;;;;;;AAeG;AAkCG,SAAU,OAAO,CAAC,GAA2B,EAAA;IAA3B,IAAA,GAAA,KAAA,KAAA,CAAA,EAAA,EAAA,GAAmB,GAAA,MAAM,EAAE,CAAA,EAAA;IACjD,IAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAE3C,IAAA,IAAI,QAAQ,CAAC,aAAa,EAAE,EAAE;AAC5B,QAAA,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;AAChC,KAAA;IAED,OAAO,cAAc,CAAC,GAAG,EAAE;AACzB,QAAA,WAAW,EAAE,yBAAyB;AACtC,QAAA,qBAAqB,EAAE,4BAA4B;AACpD,KAAA,CAAC,CAAC;AACL,CAAC;AAED,YAAY,wCAAwB;;;;"}
|
package/dist/cordova/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { af as _performApiRequest, ag as _addTidIfNecessary, ah as _createError, ai as _assert, aj as Delay, ak as _window, al as _isHttpOrHttps, am as _isWorker, an as _castAuth, J as signInWithCredential, K as linkWithCredential, ao as _assertLinkedStatus, L as reauthenticateWithCredential, ap as sendPhoneVerificationCode, aq as startEnrollPhoneMfa, ar as _link, x as PhoneAuthCredential, as as debugAssert, at as _generateEventId, au as AbstractPopupRedirectOperation, av as _assertInstanceOf, aw as _withDefaultResolver, ax as FederatedAuthProvider, ay as _fail, az as _getProjectConfig, aA as _getCurrentUrl, aB as _emulatorUrl, aC as _isChromeIOS, aD as _isFirefox, aE as _isIOSStandalone, aF as _getRedirectUrl, aG as _setWindowLocation, aH as _isMobileBrowser, aI as _isSafari, aJ as _isIOS, f as browserSessionPersistence, aK as _getRedirectResult, aL as _overrideRedirectResult, aM as AuthEventManager, aN as debugFail, aO as finalizeEnrollPhoneMfa, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, e as browserLocalPersistence, h as beforeAuthStateChanged, o as onIdTokenChanged, t as connectAuthEmulator } from './popup_redirect-
|
|
2
|
-
export { A as ActionCodeOperation, a3 as ActionCodeURL, v as AuthCredential, q as AuthErrorCodes, aS as AuthImpl, E as EmailAuthCredential, z as EmailAuthProvider, B as FacebookAuthProvider, F as FactorId, aU as FetchProvider, C as GithubAuthProvider, G as GoogleAuthProvider, w as OAuthCredential, D as OAuthProvider, O as OperationType, x as PhoneAuthCredential, P as ProviderId, aV as SAMLAuthCredential, H as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, aQ as UserImpl, ai as _assert, an as _castAuth, ay as _fail, at as _generateEventId, aT as _getClientVersion, aR as _getInstance, aK as _getRedirectResult, aL as _overrideRedirectResult, aP as _persistenceKeyName, R as applyActionCode, h as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, U as checkActionCode, Q as confirmPasswordReset, t as connectAuthEmulator, d as cordovaPopupRedirectResolver, W as createUserWithEmailAndPassword, n as debugErrorMap, m as deleteUser, a0 as fetchSignInMethodsForEmail, ab as getAdditionalUserInfo, a8 as getIdToken, a9 as getIdTokenResult, ad as getMultiFactorResolver, g as getRedirectResult, y as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, Z as isSignInWithEmailLink, K as linkWithCredential, aX as linkWithRedirect, ae as multiFactor, j as onAuthStateChanged, o as onIdTokenChanged, a4 as parseActionCodeURL, p as prodErrorMap, L as reauthenticateWithCredential, aY as reauthenticateWithRedirect, ac as reload, a1 as sendEmailVerification, N as sendPasswordResetEmail, Y as sendSignInLinkToEmail, s as setPersistence, I as signInAnonymously, J as signInWithCredential, M as signInWithCustomToken, X as signInWithEmailAndPassword, $ as signInWithEmailLink, aW as signInWithRedirect, l as signOut, aa as unlink, k as updateCurrentUser, a6 as updateEmail, a7 as updatePassword, a5 as updateProfile, u as useDeviceLanguage, a2 as verifyBeforeUpdateEmail, V as verifyPasswordResetCode } from './popup_redirect-
|
|
1
|
+
import { af as _performApiRequest, ag as _addTidIfNecessary, ah as _createError, ai as _assert, aj as Delay, ak as _window, al as _isHttpOrHttps, am as _isWorker, an as _castAuth, J as signInWithCredential, K as linkWithCredential, ao as _assertLinkedStatus, L as reauthenticateWithCredential, ap as sendPhoneVerificationCode, aq as startEnrollPhoneMfa, ar as _link, x as PhoneAuthCredential, as as debugAssert, at as _generateEventId, au as AbstractPopupRedirectOperation, av as _assertInstanceOf, aw as _withDefaultResolver, ax as FederatedAuthProvider, ay as _fail, az as _getProjectConfig, aA as _getCurrentUrl, aB as _emulatorUrl, aC as _isChromeIOS, aD as _isFirefox, aE as _isIOSStandalone, aF as _getRedirectUrl, aG as _setWindowLocation, aH as _isMobileBrowser, aI as _isSafari, aJ as _isIOS, f as browserSessionPersistence, aK as _getRedirectResult, aL as _overrideRedirectResult, aM as AuthEventManager, aN as debugFail, aO as finalizeEnrollPhoneMfa, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, e as browserLocalPersistence, h as beforeAuthStateChanged, o as onIdTokenChanged, t as connectAuthEmulator } from './popup_redirect-b7568081.js';
|
|
2
|
+
export { A as ActionCodeOperation, a3 as ActionCodeURL, v as AuthCredential, q as AuthErrorCodes, aS as AuthImpl, E as EmailAuthCredential, z as EmailAuthProvider, B as FacebookAuthProvider, F as FactorId, aU as FetchProvider, C as GithubAuthProvider, G as GoogleAuthProvider, w as OAuthCredential, D as OAuthProvider, O as OperationType, x as PhoneAuthCredential, P as ProviderId, aV as SAMLAuthCredential, H as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, aQ as UserImpl, ai as _assert, an as _castAuth, ay as _fail, at as _generateEventId, aT as _getClientVersion, aR as _getInstance, aK as _getRedirectResult, aL as _overrideRedirectResult, aP as _persistenceKeyName, R as applyActionCode, h as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, U as checkActionCode, Q as confirmPasswordReset, t as connectAuthEmulator, d as cordovaPopupRedirectResolver, W as createUserWithEmailAndPassword, n as debugErrorMap, m as deleteUser, a0 as fetchSignInMethodsForEmail, ab as getAdditionalUserInfo, a8 as getIdToken, a9 as getIdTokenResult, ad as getMultiFactorResolver, g as getRedirectResult, y as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, Z as isSignInWithEmailLink, K as linkWithCredential, aX as linkWithRedirect, ae as multiFactor, j as onAuthStateChanged, o as onIdTokenChanged, a4 as parseActionCodeURL, p as prodErrorMap, L as reauthenticateWithCredential, aY as reauthenticateWithRedirect, ac as reload, a1 as sendEmailVerification, N as sendPasswordResetEmail, Y as sendSignInLinkToEmail, s as setPersistence, I as signInAnonymously, J as signInWithCredential, M as signInWithCustomToken, X as signInWithEmailAndPassword, $ as signInWithEmailLink, aW as signInWithRedirect, l as signOut, aa as unlink, k as updateCurrentUser, a6 as updateEmail, a7 as updatePassword, a5 as updateProfile, u as useDeviceLanguage, a2 as verifyBeforeUpdateEmail, V as verifyPasswordResetCode } from './popup_redirect-b7568081.js';
|
|
3
3
|
import { __awaiter, __generator, __assign, __extends, __spreadArray } from 'tslib';
|
|
4
4
|
import { querystring, getModularInstance, getUA, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
|
|
5
5
|
import { SDK_VERSION, getApp, _getProvider } from '@firebase/app';
|
|
@@ -23,10 +23,10 @@ import '@firebase/logger';
|
|
|
23
23
|
* limitations under the License.
|
|
24
24
|
*/
|
|
25
25
|
function startSignInPhoneMfa(auth, request) {
|
|
26
|
-
return _performApiRequest(auth, "POST" /* POST */, "/v2/accounts/mfaSignIn:start" /* START_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));
|
|
26
|
+
return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts/mfaSignIn:start" /* Endpoint.START_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));
|
|
27
27
|
}
|
|
28
28
|
function finalizeSignInPhoneMfa(auth, request) {
|
|
29
|
-
return _performApiRequest(auth, "POST" /* POST */, "/v2/accounts/mfaSignIn:finalize" /* FINALIZE_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));
|
|
29
|
+
return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts/mfaSignIn:finalize" /* Endpoint.FINALIZE_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -49,7 +49,7 @@ function getRecaptchaParams(auth) {
|
|
|
49
49
|
return __awaiter(this, void 0, void 0, function () {
|
|
50
50
|
return __generator(this, function (_a) {
|
|
51
51
|
switch (_a.label) {
|
|
52
|
-
case 0: return [4 /*yield*/, _performApiRequest(auth, "GET" /* GET */, "/v1/recaptchaParams" /* GET_RECAPTCHA_PARAM */)];
|
|
52
|
+
case 0: return [4 /*yield*/, _performApiRequest(auth, "GET" /* HttpMethod.GET */, "/v1/recaptchaParams" /* Endpoint.GET_RECAPTCHA_PARAM */)];
|
|
53
53
|
case 1: return [2 /*return*/, ((_a.sent()).recaptchaSiteKey || '')];
|
|
54
54
|
}
|
|
55
55
|
});
|
|
@@ -83,7 +83,7 @@ function _loadJS(url) {
|
|
|
83
83
|
el.setAttribute('src', url);
|
|
84
84
|
el.onload = resolve;
|
|
85
85
|
el.onerror = function (e) {
|
|
86
|
-
var error = _createError("internal-error" /* INTERNAL_ERROR */);
|
|
86
|
+
var error = _createError("internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
87
87
|
error.customData = e;
|
|
88
88
|
reject(error);
|
|
89
89
|
};
|
|
@@ -93,7 +93,7 @@ function _loadJS(url) {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
function _generateCallbackName(prefix) {
|
|
96
|
-
return "__"
|
|
96
|
+
return "__".concat(prefix).concat(Math.floor(Math.random() * 1000000));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
@@ -164,7 +164,7 @@ var MockWidget = /** @class */ (function () {
|
|
|
164
164
|
var container = typeof containerOrId === 'string'
|
|
165
165
|
? document.getElementById(containerOrId)
|
|
166
166
|
: containerOrId;
|
|
167
|
-
_assert(container, "argument-error" /* ARGUMENT_ERROR */, { appName: appName });
|
|
167
|
+
_assert(container, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */, { appName: appName });
|
|
168
168
|
this.container = container;
|
|
169
169
|
this.isVisible = this.params.size !== 'invisible';
|
|
170
170
|
if (this.isVisible) {
|
|
@@ -272,20 +272,20 @@ var ReCaptchaLoaderImpl = /** @class */ (function () {
|
|
|
272
272
|
ReCaptchaLoaderImpl.prototype.load = function (auth, hl) {
|
|
273
273
|
var _this = this;
|
|
274
274
|
if (hl === void 0) { hl = ''; }
|
|
275
|
-
_assert(isHostLanguageValid(hl), auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
275
|
+
_assert(isHostLanguageValid(hl), auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
276
276
|
if (this.shouldResolveImmediately(hl)) {
|
|
277
277
|
return Promise.resolve(_window().grecaptcha);
|
|
278
278
|
}
|
|
279
279
|
return new Promise(function (resolve, reject) {
|
|
280
280
|
var networkTimeout = _window().setTimeout(function () {
|
|
281
|
-
reject(_createError(auth, "network-request-failed" /* NETWORK_REQUEST_FAILED */));
|
|
281
|
+
reject(_createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */));
|
|
282
282
|
}, NETWORK_TIMEOUT_DELAY.get());
|
|
283
283
|
_window()[_JSLOAD_CALLBACK] = function () {
|
|
284
284
|
_window().clearTimeout(networkTimeout);
|
|
285
285
|
delete _window()[_JSLOAD_CALLBACK];
|
|
286
286
|
var recaptcha = _window().grecaptcha;
|
|
287
287
|
if (!recaptcha) {
|
|
288
|
-
reject(_createError(auth, "internal-error" /* INTERNAL_ERROR */));
|
|
288
|
+
reject(_createError(auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */));
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
291
|
// Wrap the greptcha render function so that we know if the developer has
|
|
@@ -299,14 +299,14 @@ var ReCaptchaLoaderImpl = /** @class */ (function () {
|
|
|
299
299
|
_this.hostLanguage = hl;
|
|
300
300
|
resolve(recaptcha);
|
|
301
301
|
};
|
|
302
|
-
var url = RECAPTCHA_BASE
|
|
302
|
+
var url = "".concat(RECAPTCHA_BASE, "?").concat(querystring({
|
|
303
303
|
onload: _JSLOAD_CALLBACK,
|
|
304
304
|
render: 'explicit',
|
|
305
305
|
hl: hl
|
|
306
|
-
});
|
|
306
|
+
}));
|
|
307
307
|
_loadJS(url).catch(function () {
|
|
308
308
|
clearTimeout(networkTimeout);
|
|
309
|
-
reject(_createError(auth, "internal-error" /* INTERNAL_ERROR */));
|
|
309
|
+
reject(_createError(auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */));
|
|
310
310
|
});
|
|
311
311
|
});
|
|
312
312
|
};
|
|
@@ -410,11 +410,11 @@ var RecaptchaVerifier = /** @class */ (function () {
|
|
|
410
410
|
this.recaptcha = null;
|
|
411
411
|
this.auth = _castAuth(authExtern);
|
|
412
412
|
this.isInvisible = this.parameters.size === 'invisible';
|
|
413
|
-
_assert(typeof document !== 'undefined', this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
413
|
+
_assert(typeof document !== 'undefined', this.auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
|
|
414
414
|
var container = typeof containerOrId === 'string'
|
|
415
415
|
? document.getElementById(containerOrId)
|
|
416
416
|
: containerOrId;
|
|
417
|
-
_assert(container, this.auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
417
|
+
_assert(container, this.auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
418
418
|
this.container = container;
|
|
419
419
|
this.parameters.callback = this.makeTokenCallback(this.parameters.callback);
|
|
420
420
|
this._recaptchaLoader = this.auth.settings.appVerificationDisabledForTesting
|
|
@@ -508,9 +508,9 @@ var RecaptchaVerifier = /** @class */ (function () {
|
|
|
508
508
|
}
|
|
509
509
|
};
|
|
510
510
|
RecaptchaVerifier.prototype.validateStartingState = function () {
|
|
511
|
-
_assert(!this.parameters.sitekey, this.auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
512
|
-
_assert(this.isInvisible || !this.container.hasChildNodes(), this.auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
513
|
-
_assert(typeof document !== 'undefined', this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
511
|
+
_assert(!this.parameters.sitekey, this.auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
512
|
+
_assert(this.isInvisible || !this.container.hasChildNodes(), this.auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
513
|
+
_assert(typeof document !== 'undefined', this.auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
|
|
514
514
|
};
|
|
515
515
|
RecaptchaVerifier.prototype.makeTokenCallback = function (existing) {
|
|
516
516
|
var _this = this;
|
|
@@ -528,7 +528,7 @@ var RecaptchaVerifier = /** @class */ (function () {
|
|
|
528
528
|
};
|
|
529
529
|
};
|
|
530
530
|
RecaptchaVerifier.prototype.assertNotDestroyed = function () {
|
|
531
|
-
_assert(!this.destroyed, this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
531
|
+
_assert(!this.destroyed, this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
532
532
|
};
|
|
533
533
|
RecaptchaVerifier.prototype.makeRenderPromise = function () {
|
|
534
534
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -558,7 +558,7 @@ var RecaptchaVerifier = /** @class */ (function () {
|
|
|
558
558
|
return __generator(this, function (_b) {
|
|
559
559
|
switch (_b.label) {
|
|
560
560
|
case 0:
|
|
561
|
-
_assert(_isHttpOrHttps() && !_isWorker(), this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
561
|
+
_assert(_isHttpOrHttps() && !_isWorker(), this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
562
562
|
return [4 /*yield*/, domReady()];
|
|
563
563
|
case 1:
|
|
564
564
|
_b.sent();
|
|
@@ -569,7 +569,7 @@ var RecaptchaVerifier = /** @class */ (function () {
|
|
|
569
569
|
return [4 /*yield*/, getRecaptchaParams(this.auth)];
|
|
570
570
|
case 3:
|
|
571
571
|
siteKey = _b.sent();
|
|
572
|
-
_assert(siteKey, this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
572
|
+
_assert(siteKey, this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
573
573
|
this.parameters.sitekey = siteKey;
|
|
574
574
|
return [2 /*return*/];
|
|
575
575
|
}
|
|
@@ -577,7 +577,7 @@ var RecaptchaVerifier = /** @class */ (function () {
|
|
|
577
577
|
});
|
|
578
578
|
};
|
|
579
579
|
RecaptchaVerifier.prototype.getAssertedRecaptcha = function () {
|
|
580
|
-
_assert(this.recaptcha, this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
580
|
+
_assert(this.recaptcha, this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
581
581
|
return this.recaptcha;
|
|
582
582
|
};
|
|
583
583
|
return RecaptchaVerifier;
|
|
@@ -692,7 +692,7 @@ function linkWithPhoneNumber(user, phoneNumber, appVerifier) {
|
|
|
692
692
|
switch (_a.label) {
|
|
693
693
|
case 0:
|
|
694
694
|
userInternal = getModularInstance(user);
|
|
695
|
-
return [4 /*yield*/, _assertLinkedStatus(false, userInternal, "phone" /* PHONE */)];
|
|
695
|
+
return [4 /*yield*/, _assertLinkedStatus(false, userInternal, "phone" /* ProviderId.PHONE */)];
|
|
696
696
|
case 1:
|
|
697
697
|
_a.sent();
|
|
698
698
|
return [4 /*yield*/, _verifyPhoneNumber(userInternal.auth, phoneNumber, getModularInstance(appVerifier))];
|
|
@@ -749,8 +749,8 @@ function _verifyPhoneNumber(auth, options, verifier) {
|
|
|
749
749
|
_b.label = 2;
|
|
750
750
|
case 2:
|
|
751
751
|
_b.trys.push([2, , 10, 11]);
|
|
752
|
-
_assert(typeof recaptchaToken === 'string', auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
753
|
-
_assert(verifier.type === RECAPTCHA_VERIFIER_TYPE, auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
752
|
+
_assert(typeof recaptchaToken === 'string', auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
753
|
+
_assert(verifier.type === RECAPTCHA_VERIFIER_TYPE, auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
754
754
|
phoneInfoOptions = void 0;
|
|
755
755
|
if (typeof options === 'string') {
|
|
756
756
|
phoneInfoOptions = {
|
|
@@ -763,7 +763,7 @@ function _verifyPhoneNumber(auth, options, verifier) {
|
|
|
763
763
|
if (!('session' in phoneInfoOptions)) return [3 /*break*/, 7];
|
|
764
764
|
session = phoneInfoOptions.session;
|
|
765
765
|
if (!('phoneNumber' in phoneInfoOptions)) return [3 /*break*/, 4];
|
|
766
|
-
_assert(session.type === "enroll" /* ENROLL */, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
766
|
+
_assert(session.type === "enroll" /* MultiFactorSessionType.ENROLL */, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
767
767
|
return [4 /*yield*/, startEnrollPhoneMfa(auth, {
|
|
768
768
|
idToken: session.credential,
|
|
769
769
|
phoneEnrollmentInfo: {
|
|
@@ -775,10 +775,10 @@ function _verifyPhoneNumber(auth, options, verifier) {
|
|
|
775
775
|
response = _b.sent();
|
|
776
776
|
return [2 /*return*/, response.phoneSessionInfo.sessionInfo];
|
|
777
777
|
case 4:
|
|
778
|
-
_assert(session.type === "signin" /* SIGN_IN */, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
778
|
+
_assert(session.type === "signin" /* MultiFactorSessionType.SIGN_IN */, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
779
779
|
mfaEnrollmentId = ((_a = phoneInfoOptions.multiFactorHint) === null || _a === void 0 ? void 0 : _a.uid) ||
|
|
780
780
|
phoneInfoOptions.multiFactorUid;
|
|
781
|
-
_assert(mfaEnrollmentId, auth, "missing-multi-factor-info" /* MISSING_MFA_INFO */);
|
|
781
|
+
_assert(mfaEnrollmentId, auth, "missing-multi-factor-info" /* AuthErrorCode.MISSING_MFA_INFO */);
|
|
782
782
|
return [4 /*yield*/, startSignInPhoneMfa(auth, {
|
|
783
783
|
mfaPendingCredential: session.credential,
|
|
784
784
|
mfaEnrollmentId: mfaEnrollmentId,
|
|
@@ -999,9 +999,9 @@ var PhoneAuthProvider = /** @class */ (function () {
|
|
|
999
999
|
return null;
|
|
1000
1000
|
};
|
|
1001
1001
|
/** Always set to {@link ProviderId}.PHONE. */
|
|
1002
|
-
PhoneAuthProvider.PROVIDER_ID = "phone" /* PHONE */;
|
|
1002
|
+
PhoneAuthProvider.PROVIDER_ID = "phone" /* ProviderId.PHONE */;
|
|
1003
1003
|
/** Always set to {@link SignInMethod}.PHONE. */
|
|
1004
|
-
PhoneAuthProvider.PHONE_SIGN_IN_METHOD = "phone" /* PHONE */;
|
|
1004
|
+
PhoneAuthProvider.PHONE_SIGN_IN_METHOD = "phone" /* SignInMethod.PHONE */;
|
|
1005
1005
|
return PhoneAuthProvider;
|
|
1006
1006
|
}());
|
|
1007
1007
|
|
|
@@ -1058,7 +1058,7 @@ function signInWithPopup(auth, provider, resolver) {
|
|
|
1058
1058
|
authInternal = _castAuth(auth);
|
|
1059
1059
|
_assertInstanceOf(auth, provider, FederatedAuthProvider);
|
|
1060
1060
|
resolverInternal = _withDefaultResolver(authInternal, resolver);
|
|
1061
|
-
action = new PopupOperation(authInternal, "signInViaPopup" /* SIGN_IN_VIA_POPUP */, provider, resolverInternal);
|
|
1061
|
+
action = new PopupOperation(authInternal, "signInViaPopup" /* AuthEventType.SIGN_IN_VIA_POPUP */, provider, resolverInternal);
|
|
1062
1062
|
return [2 /*return*/, action.executeNotNull()];
|
|
1063
1063
|
});
|
|
1064
1064
|
});
|
|
@@ -1095,7 +1095,7 @@ function reauthenticateWithPopup(user, provider, resolver) {
|
|
|
1095
1095
|
userInternal = getModularInstance(user);
|
|
1096
1096
|
_assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);
|
|
1097
1097
|
resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
|
|
1098
|
-
action = new PopupOperation(userInternal.auth, "reauthViaPopup" /* REAUTH_VIA_POPUP */, provider, resolverInternal, userInternal);
|
|
1098
|
+
action = new PopupOperation(userInternal.auth, "reauthViaPopup" /* AuthEventType.REAUTH_VIA_POPUP */, provider, resolverInternal, userInternal);
|
|
1099
1099
|
return [2 /*return*/, action.executeNotNull()];
|
|
1100
1100
|
});
|
|
1101
1101
|
});
|
|
@@ -1131,7 +1131,7 @@ function linkWithPopup(user, provider, resolver) {
|
|
|
1131
1131
|
userInternal = getModularInstance(user);
|
|
1132
1132
|
_assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);
|
|
1133
1133
|
resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
|
|
1134
|
-
action = new PopupOperation(userInternal.auth, "linkViaPopup" /* LINK_VIA_POPUP */, provider, resolverInternal, userInternal);
|
|
1134
|
+
action = new PopupOperation(userInternal.auth, "linkViaPopup" /* AuthEventType.LINK_VIA_POPUP */, provider, resolverInternal, userInternal);
|
|
1135
1135
|
return [2 /*return*/, action.executeNotNull()];
|
|
1136
1136
|
});
|
|
1137
1137
|
});
|
|
@@ -1162,7 +1162,7 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
1162
1162
|
case 0: return [4 /*yield*/, this.execute()];
|
|
1163
1163
|
case 1:
|
|
1164
1164
|
result = _a.sent();
|
|
1165
|
-
_assert(result, this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1165
|
+
_assert(result, this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
1166
1166
|
return [2 /*return*/, result];
|
|
1167
1167
|
}
|
|
1168
1168
|
});
|
|
@@ -1195,7 +1195,7 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
1195
1195
|
});
|
|
1196
1196
|
this.resolver._isIframeWebStorageSupported(this.auth, function (isSupported) {
|
|
1197
1197
|
if (!isSupported) {
|
|
1198
|
-
_this.reject(_createError(_this.auth, "web-storage-unsupported" /* WEB_STORAGE_UNSUPPORTED */));
|
|
1198
|
+
_this.reject(_createError(_this.auth, "web-storage-unsupported" /* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */));
|
|
1199
1199
|
}
|
|
1200
1200
|
});
|
|
1201
1201
|
// Handle user closure. Notice this does *not* use await
|
|
@@ -1214,7 +1214,7 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
1214
1214
|
configurable: true
|
|
1215
1215
|
});
|
|
1216
1216
|
PopupOperation.prototype.cancel = function () {
|
|
1217
|
-
this.reject(_createError(this.auth, "cancelled-popup-request" /* EXPIRED_POPUP_REQUEST */));
|
|
1217
|
+
this.reject(_createError(this.auth, "cancelled-popup-request" /* AuthErrorCode.EXPIRED_POPUP_REQUEST */));
|
|
1218
1218
|
};
|
|
1219
1219
|
PopupOperation.prototype.cleanUp = function () {
|
|
1220
1220
|
if (this.authWindow) {
|
|
@@ -1237,8 +1237,8 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
1237
1237
|
// call could still be in flight.
|
|
1238
1238
|
_this.pollId = window.setTimeout(function () {
|
|
1239
1239
|
_this.pollId = null;
|
|
1240
|
-
_this.reject(_createError(_this.auth, "popup-closed-by-user" /* POPUP_CLOSED_BY_USER */));
|
|
1241
|
-
}, 2000 /* AUTH_EVENT */);
|
|
1240
|
+
_this.reject(_createError(_this.auth, "popup-closed-by-user" /* AuthErrorCode.POPUP_CLOSED_BY_USER */));
|
|
1241
|
+
}, 2000 /* _Timeout.AUTH_EVENT */);
|
|
1242
1242
|
return;
|
|
1243
1243
|
}
|
|
1244
1244
|
_this.pollId = window.setTimeout(poll, _POLL_WINDOW_CLOSE_TIMEOUT.get());
|
|
@@ -1294,7 +1294,7 @@ function _validateOrigin(auth) {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
1296
1296
|
// In the old SDK, this error also provides helpful messages.
|
|
1297
|
-
_fail(auth, "unauthorized-domain" /* INVALID_ORIGIN */);
|
|
1297
|
+
_fail(auth, "unauthorized-domain" /* AuthErrorCode.INVALID_ORIGIN */);
|
|
1298
1298
|
return [2 /*return*/];
|
|
1299
1299
|
}
|
|
1300
1300
|
});
|
|
@@ -1365,7 +1365,7 @@ function resetUnloadedGapiModules() {
|
|
|
1365
1365
|
// Loaded modules.
|
|
1366
1366
|
beacon.H[hint].L = beacon.H[hint].L || [];
|
|
1367
1367
|
// Set requested modules to a copy of the loaded modules.
|
|
1368
|
-
beacon.H[hint].r = __spreadArray([], beacon.H[hint].L);
|
|
1368
|
+
beacon.H[hint].r = __spreadArray([], beacon.H[hint].L, true);
|
|
1369
1369
|
// Clear pending callbacks.
|
|
1370
1370
|
if (beacon.CP) {
|
|
1371
1371
|
for (var i = 0; i < beacon.CP.length; i++) {
|
|
@@ -1396,7 +1396,7 @@ function loadGapi(auth) {
|
|
|
1396
1396
|
// failed attempt.
|
|
1397
1397
|
// Timeout when gapi.iframes.Iframe not loaded.
|
|
1398
1398
|
resetUnloadedGapiModules();
|
|
1399
|
-
reject(_createError(auth, "network-request-failed" /* NETWORK_REQUEST_FAILED */));
|
|
1399
|
+
reject(_createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */));
|
|
1400
1400
|
},
|
|
1401
1401
|
timeout: NETWORK_TIMEOUT.get()
|
|
1402
1402
|
});
|
|
@@ -1424,11 +1424,11 @@ function loadGapi(auth) {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
else {
|
|
1426
1426
|
// Gapi loader failed, throw error.
|
|
1427
|
-
reject(_createError(auth, "network-request-failed" /* NETWORK_REQUEST_FAILED */));
|
|
1427
|
+
reject(_createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */));
|
|
1428
1428
|
}
|
|
1429
1429
|
};
|
|
1430
1430
|
// Load GApi loader.
|
|
1431
|
-
return _loadJS("https://apis.google.com/js/api.js?onload="
|
|
1431
|
+
return _loadJS("https://apis.google.com/js/api.js?onload=".concat(cbName))
|
|
1432
1432
|
.catch(function (e) { return reject(e); });
|
|
1433
1433
|
}
|
|
1434
1434
|
}).catch(function (error) {
|
|
@@ -1475,16 +1475,16 @@ var IFRAME_ATTRIBUTES = {
|
|
|
1475
1475
|
// Map from apiHost to endpoint ID for passing into iframe. In current SDK, apiHost can be set to
|
|
1476
1476
|
// anything (not from a list of endpoints with IDs as in legacy), so this is the closest we can get.
|
|
1477
1477
|
var EID_FROM_APIHOST = new Map([
|
|
1478
|
-
["identitytoolkit.googleapis.com" /* API_HOST */, 'p'],
|
|
1478
|
+
["identitytoolkit.googleapis.com" /* DefaultConfig.API_HOST */, 'p'],
|
|
1479
1479
|
['staging-identitytoolkit.sandbox.googleapis.com', 's'],
|
|
1480
1480
|
['test-identitytoolkit.sandbox.googleapis.com', 't'] // test
|
|
1481
1481
|
]);
|
|
1482
1482
|
function getIframeUrl(auth) {
|
|
1483
1483
|
var config = auth.config;
|
|
1484
|
-
_assert(config.authDomain, auth, "auth-domain-config-required" /* MISSING_AUTH_DOMAIN */);
|
|
1484
|
+
_assert(config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */);
|
|
1485
1485
|
var url = config.emulator
|
|
1486
1486
|
? _emulatorUrl(config, EMULATED_IFRAME_PATH)
|
|
1487
|
-
: "https://"
|
|
1487
|
+
: "https://".concat(auth.config.authDomain, "/").concat(IFRAME_PATH);
|
|
1488
1488
|
var params = {
|
|
1489
1489
|
apiKey: config.apiKey,
|
|
1490
1490
|
appName: auth.name,
|
|
@@ -1498,7 +1498,7 @@ function getIframeUrl(auth) {
|
|
|
1498
1498
|
if (frameworks.length) {
|
|
1499
1499
|
params.fw = frameworks.join(',');
|
|
1500
1500
|
}
|
|
1501
|
-
return url
|
|
1501
|
+
return "".concat(url, "?").concat(querystring(params).slice(1));
|
|
1502
1502
|
}
|
|
1503
1503
|
function _openIframe(auth) {
|
|
1504
1504
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1510,7 +1510,7 @@ function _openIframe(auth) {
|
|
|
1510
1510
|
case 1:
|
|
1511
1511
|
context = _a.sent();
|
|
1512
1512
|
gapi = _window().gapi;
|
|
1513
|
-
_assert(gapi, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1513
|
+
_assert(gapi, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
1514
1514
|
return [2 /*return*/, context.open({
|
|
1515
1515
|
where: document.body,
|
|
1516
1516
|
url: getIframeUrl(auth),
|
|
@@ -1533,7 +1533,7 @@ function _openIframe(auth) {
|
|
|
1533
1533
|
})];
|
|
1534
1534
|
case 1:
|
|
1535
1535
|
_a.sent();
|
|
1536
|
-
networkError = _createError(auth, "network-request-failed" /* NETWORK_REQUEST_FAILED */);
|
|
1536
|
+
networkError = _createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */);
|
|
1537
1537
|
networkErrorTimer = _window().setTimeout(function () {
|
|
1538
1538
|
reject(networkError);
|
|
1539
1539
|
}, PING_TIMEOUT.get());
|
|
@@ -1599,8 +1599,7 @@ function _open(auth, url, name, width, height) {
|
|
|
1599
1599
|
var top = Math.max((window.screen.availHeight - height) / 2, 0).toString();
|
|
1600
1600
|
var left = Math.max((window.screen.availWidth - width) / 2, 0).toString();
|
|
1601
1601
|
var target = '';
|
|
1602
|
-
var options = __assign(__assign({}, BASE_POPUP_OPTIONS), { width: width.toString(), height: height.toString(), top: top,
|
|
1603
|
-
left: left });
|
|
1602
|
+
var options = __assign(__assign({}, BASE_POPUP_OPTIONS), { width: width.toString(), height: height.toString(), top: top, left: left });
|
|
1604
1603
|
// Chrome iOS 7 and 8 is returning an undefined popup win when target is
|
|
1605
1604
|
// specified, even though the popup is not necessarily blocked.
|
|
1606
1605
|
var ua = getUA().toLowerCase();
|
|
@@ -1616,7 +1615,7 @@ function _open(auth, url, name, width, height) {
|
|
|
1616
1615
|
}
|
|
1617
1616
|
var optionsString = Object.entries(options).reduce(function (accum, _a) {
|
|
1618
1617
|
var key = _a[0], value = _a[1];
|
|
1619
|
-
return ""
|
|
1618
|
+
return "".concat(accum).concat(key, "=").concat(value, ",");
|
|
1620
1619
|
}, '');
|
|
1621
1620
|
if (_isIOSStandalone(ua) && target !== '_self') {
|
|
1622
1621
|
openAsNewWindowIOS(url || '', target);
|
|
@@ -1625,7 +1624,7 @@ function _open(auth, url, name, width, height) {
|
|
|
1625
1624
|
// about:blank getting sanitized causing browsers like IE/Edge to display
|
|
1626
1625
|
// brief error message before redirecting to handler.
|
|
1627
1626
|
var newWin = window.open(url || '', target, optionsString);
|
|
1628
|
-
_assert(newWin, auth, "popup-blocked" /* POPUP_BLOCKED */);
|
|
1627
|
+
_assert(newWin, auth, "popup-blocked" /* AuthErrorCode.POPUP_BLOCKED */);
|
|
1629
1628
|
// Flaky on IE edge, encapsulate with a try and catch.
|
|
1630
1629
|
try {
|
|
1631
1630
|
newWin.focus();
|
|
@@ -1730,10 +1729,10 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
1730
1729
|
iframe = _a.sent();
|
|
1731
1730
|
manager = new AuthEventManager(auth);
|
|
1732
1731
|
iframe.register('authEvent', function (iframeEvent) {
|
|
1733
|
-
_assert(iframeEvent === null || iframeEvent === void 0 ? void 0 : iframeEvent.authEvent, auth, "invalid-auth-event" /* INVALID_AUTH_EVENT */);
|
|
1732
|
+
_assert(iframeEvent === null || iframeEvent === void 0 ? void 0 : iframeEvent.authEvent, auth, "invalid-auth-event" /* AuthErrorCode.INVALID_AUTH_EVENT */);
|
|
1734
1733
|
// TODO: Consider splitting redirect and popup events earlier on
|
|
1735
1734
|
var handled = manager.onEvent(iframeEvent.authEvent);
|
|
1736
|
-
return { status: handled ? "ACK" /* ACK */ : "ERROR" /* ERROR */ };
|
|
1735
|
+
return { status: handled ? "ACK" /* GapiOutcome.ACK */ : "ERROR" /* GapiOutcome.ERROR */ };
|
|
1737
1736
|
}, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);
|
|
1738
1737
|
this.eventManagers[auth._key()] = { manager: manager };
|
|
1739
1738
|
this.iframes[auth._key()] = iframe;
|
|
@@ -1750,7 +1749,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
1750
1749
|
if (isSupported !== undefined) {
|
|
1751
1750
|
cb(!!isSupported);
|
|
1752
1751
|
}
|
|
1753
|
-
_fail(auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1752
|
+
_fail(auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
1754
1753
|
}, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);
|
|
1755
1754
|
};
|
|
1756
1755
|
BrowserPopupRedirectResolver.prototype._originValidation = function (auth) {
|
|
@@ -1784,9 +1783,9 @@ var MultiFactorAssertionImpl = /** @class */ (function () {
|
|
|
1784
1783
|
}
|
|
1785
1784
|
MultiFactorAssertionImpl.prototype._process = function (auth, session, displayName) {
|
|
1786
1785
|
switch (session.type) {
|
|
1787
|
-
case "enroll" /* ENROLL */:
|
|
1786
|
+
case "enroll" /* MultiFactorSessionType.ENROLL */:
|
|
1788
1787
|
return this._finalizeEnroll(auth, session.credential, displayName);
|
|
1789
|
-
case "signin" /* SIGN_IN */:
|
|
1788
|
+
case "signin" /* MultiFactorSessionType.SIGN_IN */:
|
|
1790
1789
|
return this._finalizeSignIn(auth, session.credential);
|
|
1791
1790
|
default:
|
|
1792
1791
|
return debugFail('unexpected MultiFactorSessionType');
|
|
@@ -1803,7 +1802,7 @@ var MultiFactorAssertionImpl = /** @class */ (function () {
|
|
|
1803
1802
|
var PhoneMultiFactorAssertionImpl = /** @class */ (function (_super) {
|
|
1804
1803
|
__extends(PhoneMultiFactorAssertionImpl, _super);
|
|
1805
1804
|
function PhoneMultiFactorAssertionImpl(credential) {
|
|
1806
|
-
var _this = _super.call(this, "phone" /* PHONE */) || this;
|
|
1805
|
+
var _this = _super.call(this, "phone" /* FactorId.PHONE */) || this;
|
|
1807
1806
|
_this.credential = credential;
|
|
1808
1807
|
return _this;
|
|
1809
1808
|
}
|
|
@@ -1899,7 +1898,7 @@ var mintCookieFactory = function (url) { return function (user) { return __await
|
|
|
1899
1898
|
method: idToken ? 'POST' : 'DELETE',
|
|
1900
1899
|
headers: idToken
|
|
1901
1900
|
? {
|
|
1902
|
-
'Authorization': "Bearer "
|
|
1901
|
+
'Authorization': "Bearer ".concat(idToken)
|
|
1903
1902
|
}
|
|
1904
1903
|
: {}
|
|
1905
1904
|
})];
|
|
@@ -1941,11 +1940,11 @@ function getAuth(app) {
|
|
|
1941
1940
|
}
|
|
1942
1941
|
var authEmulatorHost = getDefaultEmulatorHost('auth');
|
|
1943
1942
|
if (authEmulatorHost) {
|
|
1944
|
-
connectAuthEmulator(auth, "http://"
|
|
1943
|
+
connectAuthEmulator(auth, "http://".concat(authEmulatorHost));
|
|
1945
1944
|
}
|
|
1946
1945
|
return auth;
|
|
1947
1946
|
}
|
|
1948
|
-
registerAuth("Browser" /* BROWSER */);
|
|
1947
|
+
registerAuth("Browser" /* ClientPlatform.BROWSER */);
|
|
1949
1948
|
|
|
1950
1949
|
/**
|
|
1951
1950
|
* @license
|