@firebase/auth 1.10.7 → 1.10.8-canary.25b60fdaa
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/dist/browser-cjs/{index-d8380d90.js → index-ebbd6577.js} +212 -202
- package/dist/browser-cjs/{index-d8380d90.js.map → index-ebbd6577.js.map} +1 -1
- package/dist/browser-cjs/index.js +1 -2
- package/dist/browser-cjs/index.js.map +1 -1
- package/dist/browser-cjs/internal.js +13 -18
- package/dist/browser-cjs/internal.js.map +1 -1
- package/dist/cordova/index.js +2 -3
- package/dist/cordova/index.js.map +1 -1
- package/dist/cordova/internal.js +37 -44
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-2822224b.js → popup_redirect-6226898d.js} +189 -177
- package/dist/cordova/{popup_redirect-2822224b.js.map → popup_redirect-6226898d.js.map} +1 -1
- package/dist/{esm2017/index-8e6e89cb.js → esm/index-9070a94b.js} +212 -202
- package/dist/{esm2017/index-8e6e89cb.js.map → esm/index-9070a94b.js.map} +1 -1
- package/dist/{esm2017 → esm}/index.js +1 -2
- package/dist/{esm2017 → esm}/index.js.map +1 -1
- package/dist/{esm2017 → esm}/internal.js +14 -19
- package/dist/{esm2017 → esm}/internal.js.map +1 -1
- package/dist/index.webworker.js +169 -148
- package/dist/index.webworker.js.map +1 -1
- package/dist/node/index.js +1 -2
- package/dist/node/index.js.map +1 -1
- package/dist/node/internal.js +16 -22
- package/dist/node/internal.js.map +1 -1
- package/dist/node/{totp-9fae27f4.js → totp-e66b7ec4.js} +165 -144
- package/dist/{node-esm/totp-18137433.js.map → node/totp-e66b7ec4.js.map} +1 -1
- package/dist/node-esm/index.js +1 -2
- package/dist/node-esm/index.js.map +1 -1
- package/dist/node-esm/internal.js +17 -23
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/node-esm/{totp-18137433.js → totp-dac3769c.js} +165 -144
- package/dist/{node/totp-9fae27f4.js.map → node-esm/totp-dac3769c.js.map} +1 -1
- package/dist/rn/{index-88065ec9.js → index-bd7c14b0.js} +183 -168
- package/dist/rn/{index-88065ec9.js.map → index-bd7c14b0.js.map} +1 -1
- package/dist/rn/index.js +3 -4
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/internal.js +42 -52
- package/dist/rn/internal.js.map +1 -1
- package/dist/web-extension-cjs/index.js +1 -2
- package/dist/web-extension-cjs/index.js.map +1 -1
- package/dist/web-extension-cjs/internal.js +48 -58
- package/dist/web-extension-cjs/internal.js.map +1 -1
- package/dist/web-extension-cjs/{register-e67a5434.js → register-0be0e604.js} +177 -162
- package/dist/{web-extension-esm2017/register-eb80272b.js.map → web-extension-cjs/register-0be0e604.js.map} +1 -1
- package/dist/{web-extension-esm2017 → web-extension-esm}/index.js +2 -3
- package/dist/{web-extension-esm2017 → web-extension-esm}/index.js.map +1 -1
- package/dist/{web-extension-esm2017 → web-extension-esm}/internal.js +49 -59
- package/dist/{web-extension-esm2017 → web-extension-esm}/internal.js.map +1 -1
- package/dist/{web-extension-esm2017/register-eb80272b.js → web-extension-esm/register-41226db6.js} +177 -162
- package/dist/{web-extension-cjs/register-e67a5434.js.map → web-extension-esm/register-41226db6.js.map} +1 -1
- package/internal/package.json +4 -4
- package/package.json +19 -19
- package/web-extension/package.json +3 -3
- /package/dist/{esm2017 → esm}/index.cordova.d.ts +0 -0
- /package/dist/{esm2017 → esm}/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/index.doc.d.ts +0 -0
- /package/dist/{esm2017 → esm}/index.node.d.ts +0 -0
- /package/dist/{esm2017 → esm}/index.rn.d.ts +0 -0
- /package/dist/{esm2017 → esm}/index.shared.d.ts +0 -0
- /package/dist/{esm2017 → esm}/index.web-extension.d.ts +0 -0
- /package/dist/{esm2017 → esm}/index.webworker.d.ts +0 -0
- /package/dist/{esm2017 → esm}/internal/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/scripts/run_node_tests.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/account_management/account.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/account_management/email_and_password.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/account_management/mfa.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/account_management/profile.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/create_auth_uri.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/custom_token.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/email_and_password.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/email_link.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/idp.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/mfa.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/recaptcha.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/sign_up.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/sms.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/authentication/token.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/errors.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/password_policy/get_password_policy.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/api/project_config/get_project_config.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/action_code_url.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/auth/auth_event_manager.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/auth/auth_impl.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/auth/emulator.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/auth/firebase_internal.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/auth/initialize.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/auth/middleware.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/auth/password_policy_impl.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/auth/register.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/credentials/auth_credential.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/credentials/email.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/credentials/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/credentials/oauth.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/credentials/phone.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/credentials/saml.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/errors.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/persistence/in_memory.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/persistence/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/persistence/persistence_user_manager.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/providers/email.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/providers/facebook.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/providers/federated.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/providers/github.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/providers/google.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/providers/oauth.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/providers/saml.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/providers/twitter.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/abstract_popup_redirect_operation.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/action_code_settings.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/anonymous.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/credential.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/custom_token.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/email.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/email_and_password.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/email_link.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/idp.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/strategies/redirect.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/account_info.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/additional_user_info.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/id_token_result.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/invalidation.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/link_unlink.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/proactive_refresh.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/reauthenticate.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/reload.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/token_manager.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/user_credential_impl.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/user_impl.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/user/user_metadata.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/assert.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/browser.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/delay.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/emulator.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/event_id.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/fetch_provider.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/handler.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/instantiator.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/location.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/log.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/navigator.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/providers.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/resolver.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/time.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/validate_origin.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/core/util/version.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/mfa/assertions/totp.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/mfa/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/mfa/mfa_assertion.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/mfa/mfa_error.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/mfa/mfa_info.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/mfa/mfa_resolver.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/mfa/mfa_session.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/mfa/mfa_user.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/application_verifier.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/auth.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/enum_maps.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/enums.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/id_token.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/password_policy.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/popup_redirect.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/public_types.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/model/user.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/auth_window.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/iframe/gapi.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/iframe/gapi.iframes.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/iframe/iframe.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/load_js.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/messagechannel/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/messagechannel/promise.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/messagechannel/receiver.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/messagechannel/sender.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/mfa/assertions/phone.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/persistence/browser.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/persistence/cookie_storage.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/persistence/indexed_db.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/persistence/local_storage.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/persistence/session_storage.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/popup_redirect.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/providers/phone.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/recaptcha/recaptcha.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/recaptcha/recaptcha_loader.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/recaptcha/recaptcha_mock.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/recaptcha/recaptcha_verifier.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/strategies/phone.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/strategies/popup.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/strategies/redirect.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/util/popup.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_browser/util/worker.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_cordova/plugins.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_cordova/popup_redirect/events.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_cordova/popup_redirect/popup_redirect.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_cordova/popup_redirect/utils.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_cordova/strategies/redirect.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_node/index.d.ts +0 -0
- /package/dist/{esm2017 → esm}/src/platform_react_native/persistence/react_native.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/api/helper.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/delay.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/erroring_unavailable_persistence.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/fake_service_worker.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/id_token_response.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/iframe_event.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/integration/emulator_rest_helpers.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/integration/helpers.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/integration/settings.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/jwt.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/mock_auth.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/mock_auth_credential.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/mock_fetch.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/mock_popup_redirect_resolver.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/redirect_persistence.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/helpers/timeout_stub.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/integration/flows/middleware_test_generator.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/integration/webdriver/util/auth_driver.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/integration/webdriver/util/functions.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/integration/webdriver/util/idp_page.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/integration/webdriver/util/js_load_condition.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/integration/webdriver/util/test_runner.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/integration/webdriver/util/test_server.d.ts +0 -0
- /package/dist/{esm2017 → esm}/test/integration/webdriver/util/ui_page.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/auth-web-extension-public.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/auth-web-extension.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/index.cordova.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/index.doc.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/index.node.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/index.rn.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/index.shared.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/index.web-extension.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/index.webworker.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/internal/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/package.json +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/scripts/run_node_tests.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/account_management/account.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/account_management/email_and_password.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/account_management/mfa.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/account_management/profile.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/create_auth_uri.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/custom_token.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/email_and_password.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/email_link.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/idp.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/mfa.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/recaptcha.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/sign_up.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/sms.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/authentication/token.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/errors.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/password_policy/get_password_policy.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/api/project_config/get_project_config.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/action_code_url.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/auth/auth_event_manager.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/auth/auth_impl.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/auth/emulator.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/auth/firebase_internal.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/auth/initialize.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/auth/middleware.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/auth/password_policy_impl.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/auth/register.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/credentials/auth_credential.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/credentials/email.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/credentials/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/credentials/oauth.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/credentials/phone.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/credentials/saml.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/errors.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/persistence/in_memory.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/persistence/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/persistence/persistence_user_manager.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/providers/email.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/providers/facebook.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/providers/federated.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/providers/github.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/providers/google.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/providers/oauth.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/providers/saml.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/providers/twitter.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/abstract_popup_redirect_operation.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/action_code_settings.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/anonymous.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/credential.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/custom_token.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/email.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/email_and_password.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/email_link.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/idp.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/strategies/redirect.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/account_info.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/additional_user_info.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/id_token_result.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/invalidation.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/link_unlink.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/proactive_refresh.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/reauthenticate.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/reload.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/token_manager.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/user_credential_impl.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/user_impl.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/user/user_metadata.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/assert.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/browser.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/delay.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/emulator.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/event_id.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/fetch_provider.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/handler.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/instantiator.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/location.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/log.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/navigator.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/providers.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/resolver.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/time.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/validate_origin.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/core/util/version.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/mfa/assertions/totp.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/mfa/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/mfa/mfa_assertion.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/mfa/mfa_error.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/mfa/mfa_info.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/mfa/mfa_resolver.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/mfa/mfa_session.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/mfa/mfa_user.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/application_verifier.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/auth.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/enum_maps.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/enums.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/id_token.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/password_policy.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/popup_redirect.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/public_types.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/model/user.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/auth_window.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/iframe/gapi.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/iframe/gapi.iframes.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/iframe/iframe.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/load_js.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/messagechannel/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/messagechannel/promise.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/messagechannel/receiver.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/messagechannel/sender.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/mfa/assertions/phone.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/persistence/browser.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/persistence/cookie_storage.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/persistence/indexed_db.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/persistence/local_storage.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/persistence/session_storage.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/popup_redirect.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/providers/phone.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/recaptcha/recaptcha.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/recaptcha/recaptcha_loader.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/recaptcha/recaptcha_mock.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/recaptcha/recaptcha_verifier.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/strategies/phone.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/strategies/popup.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/strategies/redirect.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/util/popup.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_browser/util/worker.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_cordova/plugins.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_cordova/popup_redirect/events.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_cordova/popup_redirect/popup_redirect.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_cordova/popup_redirect/utils.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_cordova/strategies/redirect.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_node/index.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/src/platform_react_native/persistence/react_native.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/api/helper.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/delay.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/erroring_unavailable_persistence.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/fake_service_worker.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/id_token_response.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/iframe_event.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/integration/emulator_rest_helpers.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/integration/helpers.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/integration/settings.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/jwt.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/mock_auth.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/mock_auth_credential.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/mock_fetch.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/mock_popup_redirect_resolver.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/redirect_persistence.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/helpers/timeout_stub.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/integration/flows/middleware_test_generator.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/integration/webdriver/util/auth_driver.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/integration/webdriver/util/functions.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/integration/webdriver/util/idp_page.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/integration/webdriver/util/js_load_condition.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/integration/webdriver/util/test_runner.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/integration/webdriver/util/test_server.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/test/integration/webdriver/util/ui_page.d.ts +0 -0
- /package/dist/{web-extension-esm2017 → web-extension-esm}/tsdoc-metadata.json +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ErrorFactory, isBrowserExtension, isMobileCordova, isReactNative, FirebaseError, querystring, isCloudflareWorker, isCloudWorkstation, getModularInstance, base64Decode, getUA, isIE, createSubscribe, deepEqual, pingServer, updateEmulatorBanner, querystringDecode, extractQuerystring, isEmpty } from '@firebase/util';
|
|
2
2
|
import { SDK_VERSION, _isFirebaseServerApp, _getProvider, _registerComponent, registerVersion } from '@firebase/app';
|
|
3
|
-
import { __rest } from 'tslib';
|
|
4
3
|
import { Component } from '@firebase/component';
|
|
5
4
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
6
5
|
|
|
@@ -106,7 +105,7 @@ class Receiver {
|
|
|
106
105
|
const messageEvent = event;
|
|
107
106
|
const { eventId, eventType, data } = messageEvent.data;
|
|
108
107
|
const handlers = this.handlersMap[eventType];
|
|
109
|
-
if (!
|
|
108
|
+
if (!handlers?.size) {
|
|
110
109
|
return;
|
|
111
110
|
}
|
|
112
111
|
messageEvent.ports[0].postMessage({
|
|
@@ -342,20 +341,19 @@ function _isWorker() {
|
|
|
342
341
|
typeof _window()['importScripts'] === 'function');
|
|
343
342
|
}
|
|
344
343
|
async function _getActiveServiceWorker() {
|
|
345
|
-
if (!
|
|
344
|
+
if (!navigator?.serviceWorker) {
|
|
346
345
|
return null;
|
|
347
346
|
}
|
|
348
347
|
try {
|
|
349
348
|
const registration = await navigator.serviceWorker.ready;
|
|
350
349
|
return registration.active;
|
|
351
350
|
}
|
|
352
|
-
catch
|
|
351
|
+
catch {
|
|
353
352
|
return null;
|
|
354
353
|
}
|
|
355
354
|
}
|
|
356
355
|
function _getServiceWorkerController() {
|
|
357
|
-
|
|
358
|
-
return ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker) === null || _a === void 0 ? void 0 : _a.controller) || null;
|
|
356
|
+
return navigator?.serviceWorker?.controller || null;
|
|
359
357
|
}
|
|
360
358
|
function _getWorkerGlobalScope() {
|
|
361
359
|
return _isWorker() ? self : null;
|
|
@@ -538,7 +536,6 @@ class IndexedDBLocalPersistence {
|
|
|
538
536
|
* may not resolve.
|
|
539
537
|
*/
|
|
540
538
|
async initializeSender() {
|
|
541
|
-
var _a, _b;
|
|
542
539
|
// Check to see if there's an active service worker.
|
|
543
540
|
this.activeServiceWorker = await _getActiveServiceWorker();
|
|
544
541
|
if (!this.activeServiceWorker) {
|
|
@@ -550,8 +547,8 @@ class IndexedDBLocalPersistence {
|
|
|
550
547
|
if (!results) {
|
|
551
548
|
return;
|
|
552
549
|
}
|
|
553
|
-
if (
|
|
554
|
-
|
|
550
|
+
if (results[0]?.fulfilled &&
|
|
551
|
+
results[0]?.value.includes("keyChanged" /* _EventType.KEY_CHANGED */)) {
|
|
555
552
|
this.serviceWorkerReceiverAvailable = true;
|
|
556
553
|
}
|
|
557
554
|
}
|
|
@@ -577,7 +574,7 @@ class IndexedDBLocalPersistence {
|
|
|
577
574
|
? 800 /* _TimeoutDuration.LONG_ACK */
|
|
578
575
|
: 50 /* _TimeoutDuration.ACK */);
|
|
579
576
|
}
|
|
580
|
-
catch
|
|
577
|
+
catch {
|
|
581
578
|
// This is a best effort approach. Ignore errors.
|
|
582
579
|
}
|
|
583
580
|
}
|
|
@@ -591,7 +588,7 @@ class IndexedDBLocalPersistence {
|
|
|
591
588
|
await _deleteObject(db, STORAGE_AVAILABLE_KEY);
|
|
592
589
|
return true;
|
|
593
590
|
}
|
|
594
|
-
catch
|
|
591
|
+
catch { }
|
|
595
592
|
return false;
|
|
596
593
|
}
|
|
597
594
|
async _withPendingWrite(write) {
|
|
@@ -1080,7 +1077,10 @@ function _createError(authOrCode, ...rest) {
|
|
|
1080
1077
|
return createErrorInternal(authOrCode, ...rest);
|
|
1081
1078
|
}
|
|
1082
1079
|
function _errorWithCustomMessage(auth, code, message) {
|
|
1083
|
-
const errorMap =
|
|
1080
|
+
const errorMap = {
|
|
1081
|
+
...prodErrorMap(),
|
|
1082
|
+
[code]: message
|
|
1083
|
+
};
|
|
1084
1084
|
const factory = new ErrorFactory('auth', 'Firebase', errorMap);
|
|
1085
1085
|
return factory.create(code, {
|
|
1086
1086
|
appName: auth.name
|
|
@@ -1161,15 +1161,13 @@ function debugAssert(assertion, message) {
|
|
|
1161
1161
|
* limitations under the License.
|
|
1162
1162
|
*/
|
|
1163
1163
|
function _getCurrentUrl() {
|
|
1164
|
-
|
|
1165
|
-
return (typeof self !== 'undefined' && ((_a = self.location) === null || _a === void 0 ? void 0 : _a.href)) || '';
|
|
1164
|
+
return (typeof self !== 'undefined' && self.location?.href) || '';
|
|
1166
1165
|
}
|
|
1167
1166
|
function _isHttpOrHttps() {
|
|
1168
1167
|
return _getCurrentScheme() === 'http:' || _getCurrentScheme() === 'https:';
|
|
1169
1168
|
}
|
|
1170
1169
|
function _getCurrentScheme() {
|
|
1171
|
-
|
|
1172
|
-
return (typeof self !== 'undefined' && ((_a = self.location) === null || _a === void 0 ? void 0 : _a.protocol)) || null;
|
|
1170
|
+
return (typeof self !== 'undefined' && self.location?.protocol) || null;
|
|
1173
1171
|
}
|
|
1174
1172
|
|
|
1175
1173
|
/**
|
|
@@ -1483,7 +1481,10 @@ const CookieAuthProxiedEndpoints = [
|
|
|
1483
1481
|
const DEFAULT_API_TIMEOUT_MS = new Delay(30000, 60000);
|
|
1484
1482
|
function _addTidIfNecessary(auth, request) {
|
|
1485
1483
|
if (auth.tenantId && !request.tenantId) {
|
|
1486
|
-
return
|
|
1484
|
+
return {
|
|
1485
|
+
...request,
|
|
1486
|
+
tenantId: auth.tenantId
|
|
1487
|
+
};
|
|
1487
1488
|
}
|
|
1488
1489
|
return request;
|
|
1489
1490
|
}
|
|
@@ -1501,14 +1502,20 @@ async function _performApiRequest(auth, method, path, request, customErrorMap =
|
|
|
1501
1502
|
};
|
|
1502
1503
|
}
|
|
1503
1504
|
}
|
|
1504
|
-
const query = querystring(
|
|
1505
|
+
const query = querystring({
|
|
1506
|
+
key: auth.config.apiKey,
|
|
1507
|
+
...params
|
|
1508
|
+
}).slice(1);
|
|
1505
1509
|
const headers = await auth._getAdditionalHeaders();
|
|
1506
1510
|
headers["Content-Type" /* HttpHeader.CONTENT_TYPE */] = 'application/json';
|
|
1507
1511
|
if (auth.languageCode) {
|
|
1508
1512
|
headers["X-Firebase-Locale" /* HttpHeader.X_FIREBASE_LOCALE */] = auth.languageCode;
|
|
1509
1513
|
}
|
|
1510
|
-
const fetchArgs =
|
|
1511
|
-
|
|
1514
|
+
const fetchArgs = {
|
|
1515
|
+
method,
|
|
1516
|
+
headers,
|
|
1517
|
+
...body
|
|
1518
|
+
};
|
|
1512
1519
|
/* Security-conscious server-side frameworks tend to have built in mitigations for referrer
|
|
1513
1520
|
problems". See the Cloudflare GitHub issue #487: Error: The 'referrerPolicy' field on
|
|
1514
1521
|
'RequestInitializerDict' is not implemented."
|
|
@@ -1524,7 +1531,7 @@ async function _performApiRequest(auth, method, path, request, customErrorMap =
|
|
|
1524
1531
|
}
|
|
1525
1532
|
async function _performFetchWithErrorHandling(auth, customErrorMap, fetchFn) {
|
|
1526
1533
|
auth._canInitEmulator = false;
|
|
1527
|
-
const errorMap =
|
|
1534
|
+
const errorMap = { ...SERVER_ERROR_MAP, ...customErrorMap };
|
|
1528
1535
|
try {
|
|
1529
1536
|
const networkTimeout = new NetworkTimeout(auth);
|
|
1530
1537
|
const response = await Promise.race([
|
|
@@ -1865,7 +1872,7 @@ async function getIdTokenResult(user, forceRefresh = false) {
|
|
|
1865
1872
|
const claims = _parseToken(token);
|
|
1866
1873
|
_assert(claims && claims.exp && claims.auth_time && claims.iat, userInternal.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
1867
1874
|
const firebase = typeof claims.firebase === 'object' ? claims.firebase : undefined;
|
|
1868
|
-
const signInProvider = firebase
|
|
1875
|
+
const signInProvider = firebase?.['sign_in_provider'];
|
|
1869
1876
|
return {
|
|
1870
1877
|
claims,
|
|
1871
1878
|
token,
|
|
@@ -1873,7 +1880,7 @@ async function getIdTokenResult(user, forceRefresh = false) {
|
|
|
1873
1880
|
issuedAtTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.iat)),
|
|
1874
1881
|
expirationTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.exp)),
|
|
1875
1882
|
signInProvider: signInProvider || null,
|
|
1876
|
-
signInSecondFactor:
|
|
1883
|
+
signInSecondFactor: firebase?.['sign_in_second_factor'] || null
|
|
1877
1884
|
};
|
|
1878
1885
|
}
|
|
1879
1886
|
function secondsStringToMilliseconds(seconds) {
|
|
@@ -1896,7 +1903,7 @@ function _parseToken(token) {
|
|
|
1896
1903
|
return JSON.parse(decoded);
|
|
1897
1904
|
}
|
|
1898
1905
|
catch (e) {
|
|
1899
|
-
_logError('Caught error parsing JWT payload as JSON', e
|
|
1906
|
+
_logError('Caught error parsing JWT payload as JSON', e?.toString());
|
|
1900
1907
|
return null;
|
|
1901
1908
|
}
|
|
1902
1909
|
}
|
|
@@ -1992,7 +1999,6 @@ class ProactiveRefresh {
|
|
|
1992
1999
|
}
|
|
1993
2000
|
}
|
|
1994
2001
|
getInterval(wasError) {
|
|
1995
|
-
var _a;
|
|
1996
2002
|
if (wasError) {
|
|
1997
2003
|
const interval = this.errorBackoff;
|
|
1998
2004
|
this.errorBackoff = Math.min(this.errorBackoff * 2, 960000 /* Duration.RETRY_BACKOFF_MAX */);
|
|
@@ -2001,7 +2007,7 @@ class ProactiveRefresh {
|
|
|
2001
2007
|
else {
|
|
2002
2008
|
// Reset the error backoff
|
|
2003
2009
|
this.errorBackoff = 30000 /* Duration.RETRY_BACKOFF_MIN */;
|
|
2004
|
-
const expTime =
|
|
2010
|
+
const expTime = this.user.stsTokenManager.expirationTime ?? 0;
|
|
2005
2011
|
const interval = expTime - Date.now() - 300000 /* Duration.OFFSET */;
|
|
2006
2012
|
return Math.max(0, interval);
|
|
2007
2013
|
}
|
|
@@ -2022,7 +2028,7 @@ class ProactiveRefresh {
|
|
|
2022
2028
|
}
|
|
2023
2029
|
catch (e) {
|
|
2024
2030
|
// Only retry on network errors
|
|
2025
|
-
if (
|
|
2031
|
+
if (e?.code ===
|
|
2026
2032
|
`auth/${"network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */}`) {
|
|
2027
2033
|
this.schedule(/* wasError */ true);
|
|
2028
2034
|
}
|
|
@@ -2088,14 +2094,13 @@ class UserMetadata {
|
|
|
2088
2094
|
* limitations under the License.
|
|
2089
2095
|
*/
|
|
2090
2096
|
async function _reloadWithoutSaving(user) {
|
|
2091
|
-
var _a;
|
|
2092
2097
|
const auth = user.auth;
|
|
2093
2098
|
const idToken = await user.getIdToken();
|
|
2094
2099
|
const response = await _logoutIfInvalidated(user, getAccountInfo(auth, { idToken }));
|
|
2095
|
-
_assert(response
|
|
2100
|
+
_assert(response?.users.length, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
2096
2101
|
const coreAccount = response.users[0];
|
|
2097
2102
|
user._notifyReloadListener(coreAccount);
|
|
2098
|
-
const newProviderData =
|
|
2103
|
+
const newProviderData = coreAccount.providerUserInfo?.length
|
|
2099
2104
|
? extractProviderData(coreAccount.providerUserInfo)
|
|
2100
2105
|
: [];
|
|
2101
2106
|
const providerData = mergeProviderData(user.providerData, newProviderData);
|
|
@@ -2105,7 +2110,7 @@ async function _reloadWithoutSaving(user) {
|
|
|
2105
2110
|
// On the other hand, if it was not anonymous before, it should never be
|
|
2106
2111
|
// considered anonymous now.
|
|
2107
2112
|
const oldIsAnonymous = user.isAnonymous;
|
|
2108
|
-
const newIsAnonymous = !(user.email && coreAccount.passwordHash) && !
|
|
2113
|
+
const newIsAnonymous = !(user.email && coreAccount.passwordHash) && !providerData?.length;
|
|
2109
2114
|
const isAnonymous = !oldIsAnonymous ? false : newIsAnonymous;
|
|
2110
2115
|
const updates = {
|
|
2111
2116
|
uid: coreAccount.localId,
|
|
@@ -2142,8 +2147,7 @@ function mergeProviderData(original, newData) {
|
|
|
2142
2147
|
return [...deduped, ...newData];
|
|
2143
2148
|
}
|
|
2144
2149
|
function extractProviderData(providers) {
|
|
2145
|
-
return providers.map((
|
|
2146
|
-
var { providerId } = _a, provider = __rest(_a, ["providerId"]);
|
|
2150
|
+
return providers.map(({ providerId, ...provider }) => {
|
|
2147
2151
|
return {
|
|
2148
2152
|
providerId,
|
|
2149
2153
|
uid: provider.rawId || '',
|
|
@@ -2335,8 +2339,7 @@ function assertStringOrUndefined(assertion, appName) {
|
|
|
2335
2339
|
_assert(typeof assertion === 'string' || typeof assertion === 'undefined', "internal-error" /* AuthErrorCode.INTERNAL_ERROR */, { appName });
|
|
2336
2340
|
}
|
|
2337
2341
|
class UserImpl {
|
|
2338
|
-
constructor(
|
|
2339
|
-
var { uid, auth, stsTokenManager } = _a, opt = __rest(_a, ["uid", "auth", "stsTokenManager"]);
|
|
2342
|
+
constructor({ uid, auth, stsTokenManager, ...opt }) {
|
|
2340
2343
|
// For the user object, provider is always Firebase.
|
|
2341
2344
|
this.providerId = "firebase" /* ProviderId.FIREBASE */;
|
|
2342
2345
|
this.proactiveRefresh = new ProactiveRefresh(this);
|
|
@@ -2384,12 +2387,16 @@ class UserImpl {
|
|
|
2384
2387
|
this.phoneNumber = user.phoneNumber;
|
|
2385
2388
|
this.isAnonymous = user.isAnonymous;
|
|
2386
2389
|
this.tenantId = user.tenantId;
|
|
2387
|
-
this.providerData = user.providerData.map(userInfo => (
|
|
2390
|
+
this.providerData = user.providerData.map(userInfo => ({ ...userInfo }));
|
|
2388
2391
|
this.metadata._copy(user.metadata);
|
|
2389
2392
|
this.stsTokenManager._assign(user.stsTokenManager);
|
|
2390
2393
|
}
|
|
2391
2394
|
_clone(auth) {
|
|
2392
|
-
const newUser = new UserImpl(
|
|
2395
|
+
const newUser = new UserImpl({
|
|
2396
|
+
...this,
|
|
2397
|
+
auth,
|
|
2398
|
+
stsTokenManager: this.stsTokenManager._clone()
|
|
2399
|
+
});
|
|
2393
2400
|
newUser.metadata._copy(this.metadata);
|
|
2394
2401
|
return newUser;
|
|
2395
2402
|
}
|
|
@@ -2444,26 +2451,40 @@ class UserImpl {
|
|
|
2444
2451
|
return this.auth.signOut();
|
|
2445
2452
|
}
|
|
2446
2453
|
toJSON() {
|
|
2447
|
-
return
|
|
2454
|
+
return {
|
|
2455
|
+
uid: this.uid,
|
|
2456
|
+
email: this.email || undefined,
|
|
2457
|
+
emailVerified: this.emailVerified,
|
|
2458
|
+
displayName: this.displayName || undefined,
|
|
2459
|
+
isAnonymous: this.isAnonymous,
|
|
2460
|
+
photoURL: this.photoURL || undefined,
|
|
2461
|
+
phoneNumber: this.phoneNumber || undefined,
|
|
2462
|
+
tenantId: this.tenantId || undefined,
|
|
2463
|
+
providerData: this.providerData.map(userInfo => ({ ...userInfo })),
|
|
2464
|
+
stsTokenManager: this.stsTokenManager.toJSON(),
|
|
2448
2465
|
// Redirect event ID must be maintained in case there is a pending
|
|
2449
2466
|
// redirect event.
|
|
2450
|
-
_redirectEventId: this._redirectEventId
|
|
2467
|
+
_redirectEventId: this._redirectEventId,
|
|
2468
|
+
...this.metadata.toJSON(),
|
|
2451
2469
|
// Required for compatibility with the legacy SDK (go/firebase-auth-sdk-persistence-parsing):
|
|
2452
|
-
apiKey: this.auth.config.apiKey,
|
|
2470
|
+
apiKey: this.auth.config.apiKey,
|
|
2471
|
+
appName: this.auth.name
|
|
2472
|
+
// Missing authDomain will be tolerated by the legacy SDK.
|
|
2473
|
+
// stsTokenManager.apiKey isn't actually required (despite the legacy SDK persisting it).
|
|
2474
|
+
};
|
|
2453
2475
|
}
|
|
2454
2476
|
get refreshToken() {
|
|
2455
2477
|
return this.stsTokenManager.refreshToken || '';
|
|
2456
2478
|
}
|
|
2457
2479
|
static _fromJSON(auth, object) {
|
|
2458
|
-
|
|
2459
|
-
const
|
|
2460
|
-
const
|
|
2461
|
-
const
|
|
2462
|
-
const
|
|
2463
|
-
const
|
|
2464
|
-
const
|
|
2465
|
-
const
|
|
2466
|
-
const lastLoginAt = (_h = object.lastLoginAt) !== null && _h !== void 0 ? _h : undefined;
|
|
2480
|
+
const displayName = object.displayName ?? undefined;
|
|
2481
|
+
const email = object.email ?? undefined;
|
|
2482
|
+
const phoneNumber = object.phoneNumber ?? undefined;
|
|
2483
|
+
const photoURL = object.photoURL ?? undefined;
|
|
2484
|
+
const tenantId = object.tenantId ?? undefined;
|
|
2485
|
+
const _redirectEventId = object._redirectEventId ?? undefined;
|
|
2486
|
+
const createdAt = object.createdAt ?? undefined;
|
|
2487
|
+
const lastLoginAt = object.lastLoginAt ?? undefined;
|
|
2467
2488
|
const { uid, emailVerified, isAnonymous, providerData, stsTokenManager: plainObjectTokenManager } = object;
|
|
2468
2489
|
_assert(uid && plainObjectTokenManager, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
2469
2490
|
const stsTokenManager = StsTokenManager.fromJSON(this.name, plainObjectTokenManager);
|
|
@@ -2493,7 +2514,7 @@ class UserImpl {
|
|
|
2493
2514
|
lastLoginAt
|
|
2494
2515
|
});
|
|
2495
2516
|
if (providerData && Array.isArray(providerData)) {
|
|
2496
|
-
user.providerData = providerData.map(userInfo => (
|
|
2517
|
+
user.providerData = providerData.map(userInfo => ({ ...userInfo }));
|
|
2497
2518
|
}
|
|
2498
2519
|
if (_redirectEventId) {
|
|
2499
2520
|
user._redirectEventId = _redirectEventId;
|
|
@@ -2530,7 +2551,7 @@ class UserImpl {
|
|
|
2530
2551
|
const providerData = coreAccount.providerUserInfo !== undefined
|
|
2531
2552
|
? extractProviderData(coreAccount.providerUserInfo)
|
|
2532
2553
|
: [];
|
|
2533
|
-
const isAnonymous = !(coreAccount.email && coreAccount.passwordHash) && !
|
|
2554
|
+
const isAnonymous = !(coreAccount.email && coreAccount.passwordHash) && !providerData?.length;
|
|
2534
2555
|
const stsTokenManager = new StsTokenManager();
|
|
2535
2556
|
stsTokenManager.updateFromIdToken(idToken);
|
|
2536
2557
|
// Initialize the Firebase Auth user.
|
|
@@ -2552,7 +2573,7 @@ class UserImpl {
|
|
|
2552
2573
|
providerData,
|
|
2553
2574
|
metadata: new UserMetadata(coreAccount.createdAt, coreAccount.lastLoginAt),
|
|
2554
2575
|
isAnonymous: !(coreAccount.email && coreAccount.passwordHash) &&
|
|
2555
|
-
!
|
|
2576
|
+
!providerData?.length
|
|
2556
2577
|
};
|
|
2557
2578
|
Object.assign(user, updates);
|
|
2558
2579
|
return user;
|
|
@@ -2751,7 +2772,7 @@ class PersistenceUserManager {
|
|
|
2751
2772
|
break;
|
|
2752
2773
|
}
|
|
2753
2774
|
}
|
|
2754
|
-
catch
|
|
2775
|
+
catch { }
|
|
2755
2776
|
}
|
|
2756
2777
|
// If we find the user in a persistence that does support migration, use
|
|
2757
2778
|
// that migration path (of only persistences that support migration)
|
|
@@ -2774,7 +2795,7 @@ class PersistenceUserManager {
|
|
|
2774
2795
|
try {
|
|
2775
2796
|
await persistence._remove(key);
|
|
2776
2797
|
}
|
|
2777
|
-
catch
|
|
2798
|
+
catch { }
|
|
2778
2799
|
}
|
|
2779
2800
|
}));
|
|
2780
2801
|
return new PersistenceUserManager(selectedPersistence, auth, userKey);
|
|
@@ -2844,7 +2865,7 @@ function _getBrowserName(userAgent) {
|
|
|
2844
2865
|
// Most modern browsers have name/version at end of user agent string.
|
|
2845
2866
|
const re = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/;
|
|
2846
2867
|
const matches = userAgent.match(re);
|
|
2847
|
-
if (
|
|
2868
|
+
if (matches?.length === 2) {
|
|
2848
2869
|
return matches[1];
|
|
2849
2870
|
}
|
|
2850
2871
|
}
|
|
@@ -2884,8 +2905,7 @@ function _isIOS7Or8(ua = getUA()) {
|
|
|
2884
2905
|
/(iPad|iPhone|iPod).*OS 8_\d/i.test(ua));
|
|
2885
2906
|
}
|
|
2886
2907
|
function _isIOSStandalone(ua = getUA()) {
|
|
2887
|
-
|
|
2888
|
-
return _isIOS(ua) && !!((_a = window.navigator) === null || _a === void 0 ? void 0 : _a.standalone);
|
|
2908
|
+
return _isIOS(ua) && !!window.navigator?.standalone;
|
|
2889
2909
|
}
|
|
2890
2910
|
function _isIE10() {
|
|
2891
2911
|
return isIE() && document.documentMode === 10;
|
|
@@ -3016,7 +3036,7 @@ class AuthMiddlewareQueue {
|
|
|
3016
3036
|
}
|
|
3017
3037
|
}
|
|
3018
3038
|
throw this.auth._errorFactory.create("login-blocked" /* AuthErrorCode.LOGIN_BLOCKED */, {
|
|
3019
|
-
originalMessage: e
|
|
3039
|
+
originalMessage: e?.message
|
|
3020
3040
|
});
|
|
3021
3041
|
}
|
|
3022
3042
|
}
|
|
@@ -3074,13 +3094,12 @@ const MINIMUM_MIN_PASSWORD_LENGTH = 6;
|
|
|
3074
3094
|
*/
|
|
3075
3095
|
class PasswordPolicyImpl {
|
|
3076
3096
|
constructor(response) {
|
|
3077
|
-
var _a, _b, _c, _d;
|
|
3078
3097
|
// Only include custom strength options defined in the response.
|
|
3079
3098
|
const responseOptions = response.customStrengthOptions;
|
|
3080
3099
|
this.customStrengthOptions = {};
|
|
3081
3100
|
// TODO: Remove once the backend is updated to include the minimum min password length instead of undefined when there is no minimum length set.
|
|
3082
3101
|
this.customStrengthOptions.minPasswordLength =
|
|
3083
|
-
|
|
3102
|
+
responseOptions.minPasswordLength ?? MINIMUM_MIN_PASSWORD_LENGTH;
|
|
3084
3103
|
if (responseOptions.maxPasswordLength) {
|
|
3085
3104
|
this.customStrengthOptions.maxPasswordLength =
|
|
3086
3105
|
responseOptions.maxPasswordLength;
|
|
@@ -3107,12 +3126,11 @@ class PasswordPolicyImpl {
|
|
|
3107
3126
|
}
|
|
3108
3127
|
// Use an empty string if no non-alphanumeric characters are specified in the response.
|
|
3109
3128
|
this.allowedNonAlphanumericCharacters =
|
|
3110
|
-
|
|
3111
|
-
this.forceUpgradeOnSignin =
|
|
3129
|
+
response.allowedNonAlphanumericCharacters?.join('') ?? '';
|
|
3130
|
+
this.forceUpgradeOnSignin = response.forceUpgradeOnSignin ?? false;
|
|
3112
3131
|
this.schemaVersion = response.schemaVersion;
|
|
3113
3132
|
}
|
|
3114
3133
|
validatePassword(password) {
|
|
3115
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3116
3134
|
const status = {
|
|
3117
3135
|
isValid: true,
|
|
3118
3136
|
passwordPolicy: this
|
|
@@ -3121,12 +3139,12 @@ class PasswordPolicyImpl {
|
|
|
3121
3139
|
this.validatePasswordLengthOptions(password, status);
|
|
3122
3140
|
this.validatePasswordCharacterOptions(password, status);
|
|
3123
3141
|
// Combine the status into single isValid property.
|
|
3124
|
-
status.isValid && (status.isValid =
|
|
3125
|
-
status.isValid && (status.isValid =
|
|
3126
|
-
status.isValid && (status.isValid =
|
|
3127
|
-
status.isValid && (status.isValid =
|
|
3128
|
-
status.isValid && (status.isValid =
|
|
3129
|
-
status.isValid && (status.isValid =
|
|
3142
|
+
status.isValid && (status.isValid = status.meetsMinPasswordLength ?? true);
|
|
3143
|
+
status.isValid && (status.isValid = status.meetsMaxPasswordLength ?? true);
|
|
3144
|
+
status.isValid && (status.isValid = status.containsLowercaseLetter ?? true);
|
|
3145
|
+
status.isValid && (status.isValid = status.containsUppercaseLetter ?? true);
|
|
3146
|
+
status.isValid && (status.isValid = status.containsNumericCharacter ?? true);
|
|
3147
|
+
status.isValid && (status.isValid = status.containsNonAlphanumericCharacter ?? true);
|
|
3130
3148
|
return status;
|
|
3131
3149
|
}
|
|
3132
3150
|
/**
|
|
@@ -3263,18 +3281,17 @@ class AuthImpl {
|
|
|
3263
3281
|
// Have to check for app deletion throughout initialization (after each
|
|
3264
3282
|
// promise resolution)
|
|
3265
3283
|
this._initializationPromise = this.queue(async () => {
|
|
3266
|
-
var _a, _b, _c;
|
|
3267
3284
|
if (this._deleted) {
|
|
3268
3285
|
return;
|
|
3269
3286
|
}
|
|
3270
3287
|
this.persistenceManager = await PersistenceUserManager.create(this, persistenceHierarchy);
|
|
3271
|
-
|
|
3288
|
+
this._resolvePersistenceManagerAvailable?.();
|
|
3272
3289
|
if (this._deleted) {
|
|
3273
3290
|
return;
|
|
3274
3291
|
}
|
|
3275
3292
|
// Initialize the resolver early if necessary (only applicable to web:
|
|
3276
3293
|
// this will cause the iframe to load immediately in certain cases)
|
|
3277
|
-
if (
|
|
3294
|
+
if (this._popupRedirectResolver?._shouldInitProactively) {
|
|
3278
3295
|
// If this fails, don't halt auth loading
|
|
3279
3296
|
try {
|
|
3280
3297
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -3284,7 +3301,7 @@ class AuthImpl {
|
|
|
3284
3301
|
}
|
|
3285
3302
|
}
|
|
3286
3303
|
await this.initializeCurrentUser(popupRedirectResolver);
|
|
3287
|
-
this.lastNotifiedUid =
|
|
3304
|
+
this.lastNotifiedUid = this.currentUser?.uid || null;
|
|
3288
3305
|
if (this._deleted) {
|
|
3289
3306
|
return;
|
|
3290
3307
|
}
|
|
@@ -3329,7 +3346,6 @@ class AuthImpl {
|
|
|
3329
3346
|
}
|
|
3330
3347
|
}
|
|
3331
3348
|
async initializeCurrentUser(popupRedirectResolver) {
|
|
3332
|
-
var _a;
|
|
3333
3349
|
if (_isFirebaseServerApp(this.app)) {
|
|
3334
3350
|
const idToken = this.app.settings.authIdToken;
|
|
3335
3351
|
if (idToken) {
|
|
@@ -3349,15 +3365,15 @@ class AuthImpl {
|
|
|
3349
3365
|
let needsTocheckMiddleware = false;
|
|
3350
3366
|
if (popupRedirectResolver && this.config.authDomain) {
|
|
3351
3367
|
await this.getOrInitRedirectPersistenceManager();
|
|
3352
|
-
const redirectUserEventId =
|
|
3353
|
-
const storedUserEventId = futureCurrentUser
|
|
3368
|
+
const redirectUserEventId = this.redirectUser?._redirectEventId;
|
|
3369
|
+
const storedUserEventId = futureCurrentUser?._redirectEventId;
|
|
3354
3370
|
const result = await this.tryRedirectSignIn(popupRedirectResolver);
|
|
3355
3371
|
// If the stored user (i.e. the old "currentUser") has a redirectId that
|
|
3356
3372
|
// matches the redirect user, then we want to initially sign in with the
|
|
3357
3373
|
// new user object from result.
|
|
3358
3374
|
// TODO(samgho): More thoroughly test all of this
|
|
3359
3375
|
if ((!redirectUserEventId || redirectUserEventId === storedUserEventId) &&
|
|
3360
|
-
|
|
3376
|
+
result?.user) {
|
|
3361
3377
|
futureCurrentUser = result.user;
|
|
3362
3378
|
needsTocheckMiddleware = true;
|
|
3363
3379
|
}
|
|
@@ -3432,7 +3448,7 @@ class AuthImpl {
|
|
|
3432
3448
|
await _reloadWithoutSaving(user);
|
|
3433
3449
|
}
|
|
3434
3450
|
catch (e) {
|
|
3435
|
-
if (
|
|
3451
|
+
if (e?.code !==
|
|
3436
3452
|
`auth/${"network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */}`) {
|
|
3437
3453
|
// Something's wrong with the user's token. Log them out and remove
|
|
3438
3454
|
// them from storage
|
|
@@ -3589,12 +3605,11 @@ class AuthImpl {
|
|
|
3589
3605
|
}
|
|
3590
3606
|
}
|
|
3591
3607
|
toJSON() {
|
|
3592
|
-
var _a;
|
|
3593
3608
|
return {
|
|
3594
3609
|
apiKey: this.config.apiKey,
|
|
3595
3610
|
authDomain: this.config.authDomain,
|
|
3596
3611
|
appName: this.name,
|
|
3597
|
-
currentUser:
|
|
3612
|
+
currentUser: this._currentUser?.toJSON()
|
|
3598
3613
|
};
|
|
3599
3614
|
}
|
|
3600
3615
|
async _setRedirectUser(user, popupRedirectResolver) {
|
|
@@ -3615,16 +3630,15 @@ class AuthImpl {
|
|
|
3615
3630
|
return this.redirectPersistenceManager;
|
|
3616
3631
|
}
|
|
3617
3632
|
async _redirectUserForId(id) {
|
|
3618
|
-
var _a, _b;
|
|
3619
3633
|
// Make sure we've cleared any pending persistence actions if we're not in
|
|
3620
3634
|
// the initializer
|
|
3621
3635
|
if (this._isInitialized) {
|
|
3622
3636
|
await this.queue(async () => { });
|
|
3623
3637
|
}
|
|
3624
|
-
if (
|
|
3638
|
+
if (this._currentUser?._redirectEventId === id) {
|
|
3625
3639
|
return this._currentUser;
|
|
3626
3640
|
}
|
|
3627
|
-
if (
|
|
3641
|
+
if (this.redirectUser?._redirectEventId === id) {
|
|
3628
3642
|
return this.redirectUser;
|
|
3629
3643
|
}
|
|
3630
3644
|
return null;
|
|
@@ -3660,12 +3674,11 @@ class AuthImpl {
|
|
|
3660
3674
|
return this.currentUser;
|
|
3661
3675
|
}
|
|
3662
3676
|
notifyAuthListeners() {
|
|
3663
|
-
var _a, _b;
|
|
3664
3677
|
if (!this._isInitialized) {
|
|
3665
3678
|
return;
|
|
3666
3679
|
}
|
|
3667
3680
|
this.idTokenSubscription.next(this.currentUser);
|
|
3668
|
-
const currentUid =
|
|
3681
|
+
const currentUid = this.currentUser?.uid ?? null;
|
|
3669
3682
|
if (this.lastNotifiedUid !== currentUid) {
|
|
3670
3683
|
this.lastNotifiedUid = currentUid;
|
|
3671
3684
|
this.authStateSubscription.next(this.currentUser);
|
|
@@ -3750,7 +3763,6 @@ class AuthImpl {
|
|
|
3750
3763
|
return this.frameworks;
|
|
3751
3764
|
}
|
|
3752
3765
|
async _getAdditionalHeaders() {
|
|
3753
|
-
var _a;
|
|
3754
3766
|
// Additional headers on every request
|
|
3755
3767
|
const headers = {
|
|
3756
3768
|
["X-Client-Version" /* HttpHeader.X_CLIENT_VERSION */]: this.clientVersion
|
|
@@ -3759,10 +3771,11 @@ class AuthImpl {
|
|
|
3759
3771
|
headers["X-Firebase-gmpid" /* HttpHeader.X_FIREBASE_GMPID */] = this.app.options.appId;
|
|
3760
3772
|
}
|
|
3761
3773
|
// If the heartbeat service exists, add the heartbeat string
|
|
3762
|
-
const heartbeatsHeader = await
|
|
3774
|
+
const heartbeatsHeader = await this.heartbeatServiceProvider
|
|
3763
3775
|
.getImmediate({
|
|
3764
3776
|
optional: true
|
|
3765
|
-
})
|
|
3777
|
+
})
|
|
3778
|
+
?.getHeartbeatsHeader();
|
|
3766
3779
|
if (heartbeatsHeader) {
|
|
3767
3780
|
headers["X-Firebase-Client" /* HttpHeader.X_FIREBASE_CLIENT */] = heartbeatsHeader;
|
|
3768
3781
|
}
|
|
@@ -3774,20 +3787,20 @@ class AuthImpl {
|
|
|
3774
3787
|
return headers;
|
|
3775
3788
|
}
|
|
3776
3789
|
async _getAppCheckToken() {
|
|
3777
|
-
var _a;
|
|
3778
3790
|
if (_isFirebaseServerApp(this.app) && this.app.settings.appCheckToken) {
|
|
3779
3791
|
return this.app.settings.appCheckToken;
|
|
3780
3792
|
}
|
|
3781
|
-
const appCheckTokenResult = await
|
|
3782
|
-
.getImmediate({ optional: true })
|
|
3783
|
-
|
|
3793
|
+
const appCheckTokenResult = await this.appCheckServiceProvider
|
|
3794
|
+
.getImmediate({ optional: true })
|
|
3795
|
+
?.getToken();
|
|
3796
|
+
if (appCheckTokenResult?.error) {
|
|
3784
3797
|
// Context: appCheck.getToken() will never throw even if an error happened.
|
|
3785
3798
|
// In the error case, a dummy token will be returned along with an error field describing
|
|
3786
3799
|
// the error. In general, we shouldn't care about the error condition and just use
|
|
3787
3800
|
// the token (actual or dummy) to send requests.
|
|
3788
3801
|
_logWarn(`Error while retrieving App Check token: ${appCheckTokenResult.error}`);
|
|
3789
3802
|
}
|
|
3790
|
-
return appCheckTokenResult
|
|
3803
|
+
return appCheckTokenResult?.token;
|
|
3791
3804
|
}
|
|
3792
3805
|
}
|
|
3793
3806
|
/**
|
|
@@ -3887,20 +3900,17 @@ class MockReCaptcha {
|
|
|
3887
3900
|
return id;
|
|
3888
3901
|
}
|
|
3889
3902
|
reset(optWidgetId) {
|
|
3890
|
-
var _a;
|
|
3891
3903
|
const id = optWidgetId || _WIDGET_ID_START;
|
|
3892
|
-
void
|
|
3904
|
+
void this._widgets.get(id)?.delete();
|
|
3893
3905
|
this._widgets.delete(id);
|
|
3894
3906
|
}
|
|
3895
3907
|
getResponse(optWidgetId) {
|
|
3896
|
-
var _a;
|
|
3897
3908
|
const id = optWidgetId || _WIDGET_ID_START;
|
|
3898
|
-
return
|
|
3909
|
+
return this._widgets.get(id)?.getResponse() || '';
|
|
3899
3910
|
}
|
|
3900
3911
|
async execute(optWidgetId) {
|
|
3901
|
-
var _a;
|
|
3902
3912
|
const id = optWidgetId || _WIDGET_ID_START;
|
|
3903
|
-
void
|
|
3913
|
+
void this._widgets.get(id)?.execute();
|
|
3904
3914
|
return '';
|
|
3905
3915
|
}
|
|
3906
3916
|
}
|
|
@@ -4140,7 +4150,7 @@ async function injectRecaptchaFields(auth, request, action, isCaptchaResp = fals
|
|
|
4140
4150
|
captchaResponse = await verifier.verify(action, true);
|
|
4141
4151
|
}
|
|
4142
4152
|
}
|
|
4143
|
-
const newRequest =
|
|
4153
|
+
const newRequest = { ...request };
|
|
4144
4154
|
if (action === "mfaSmsEnrollment" /* RecaptchaActionName.MFA_SMS_ENROLLMENT */ ||
|
|
4145
4155
|
action === "mfaSmsSignIn" /* RecaptchaActionName.MFA_SMS_SIGNIN */) {
|
|
4146
4156
|
if ('phoneEnrollmentInfo' in newRequest) {
|
|
@@ -4182,10 +4192,10 @@ async function injectRecaptchaFields(auth, request, action, isCaptchaResp = fals
|
|
|
4182
4192
|
return newRequest;
|
|
4183
4193
|
}
|
|
4184
4194
|
async function handleRecaptchaFlow(authInstance, request, actionName, actionMethod, recaptchaAuthProvider) {
|
|
4185
|
-
var _a, _b;
|
|
4186
4195
|
if (recaptchaAuthProvider === "EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */) {
|
|
4187
|
-
if (
|
|
4188
|
-
._getRecaptchaConfig()
|
|
4196
|
+
if (authInstance
|
|
4197
|
+
._getRecaptchaConfig()
|
|
4198
|
+
?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */)) {
|
|
4189
4199
|
const requestWithRecaptcha = await injectRecaptchaFields(authInstance, request, actionName, actionName === "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */);
|
|
4190
4200
|
return actionMethod(authInstance, requestWithRecaptcha);
|
|
4191
4201
|
}
|
|
@@ -4203,13 +4213,14 @@ async function handleRecaptchaFlow(authInstance, request, actionName, actionMeth
|
|
|
4203
4213
|
}
|
|
4204
4214
|
}
|
|
4205
4215
|
else if (recaptchaAuthProvider === "PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */) {
|
|
4206
|
-
if (
|
|
4207
|
-
._getRecaptchaConfig()
|
|
4216
|
+
if (authInstance
|
|
4217
|
+
._getRecaptchaConfig()
|
|
4218
|
+
?.isProviderEnabled("PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */)) {
|
|
4208
4219
|
const requestWithRecaptcha = await injectRecaptchaFields(authInstance, request, actionName);
|
|
4209
4220
|
return actionMethod(authInstance, requestWithRecaptcha).catch(async (error) => {
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4221
|
+
if (authInstance
|
|
4222
|
+
._getRecaptchaConfig()
|
|
4223
|
+
?.getProviderEnforcementState("PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */) === "AUDIT" /* EnforcementState.AUDIT */) {
|
|
4213
4224
|
// AUDIT mode
|
|
4214
4225
|
if (error.code === `auth/${"missing-recaptcha-token" /* AuthErrorCode.MISSING_RECAPTCHA_TOKEN */}` ||
|
|
4215
4226
|
error.code === `auth/${"invalid-app-credential" /* AuthErrorCode.INVALID_APP_CREDENTIAL */}`) {
|
|
@@ -4306,7 +4317,7 @@ function initializeAuth(app, deps) {
|
|
|
4306
4317
|
if (provider.isInitialized()) {
|
|
4307
4318
|
const auth = provider.getImmediate();
|
|
4308
4319
|
const initialOptions = provider.getOptions();
|
|
4309
|
-
if (deepEqual(initialOptions, deps
|
|
4320
|
+
if (deepEqual(initialOptions, deps ?? {})) {
|
|
4310
4321
|
return auth;
|
|
4311
4322
|
}
|
|
4312
4323
|
else {
|
|
@@ -4317,15 +4328,15 @@ function initializeAuth(app, deps) {
|
|
|
4317
4328
|
return auth;
|
|
4318
4329
|
}
|
|
4319
4330
|
function _initializeAuthInstance(auth, deps) {
|
|
4320
|
-
const persistence =
|
|
4331
|
+
const persistence = deps?.persistence || [];
|
|
4321
4332
|
const hierarchy = (Array.isArray(persistence) ? persistence : [persistence]).map(_getInstance);
|
|
4322
|
-
if (deps
|
|
4333
|
+
if (deps?.errorMap) {
|
|
4323
4334
|
auth._updateErrorMap(deps.errorMap);
|
|
4324
4335
|
}
|
|
4325
4336
|
// This promise is intended to float; auth initialization happens in the
|
|
4326
4337
|
// background, meanwhile the auth object may be used by the app.
|
|
4327
4338
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
4328
|
-
auth._initializeWithPersistence(hierarchy, deps
|
|
4339
|
+
auth._initializeWithPersistence(hierarchy, deps?.popupRedirectResolver);
|
|
4329
4340
|
}
|
|
4330
4341
|
|
|
4331
4342
|
/**
|
|
@@ -4353,7 +4364,7 @@ function _initializeAuthInstance(auth, deps) {
|
|
|
4353
4364
|
function connectAuthEmulator(auth, url, options) {
|
|
4354
4365
|
const authInternal = _castAuth(auth);
|
|
4355
4366
|
_assert(/^https?:\/\//.test(url), authInternal, "invalid-emulator-scheme" /* AuthErrorCode.INVALID_EMULATOR_SCHEME */);
|
|
4356
|
-
const disableWarnings = !!
|
|
4367
|
+
const disableWarnings = !!options?.disableWarnings;
|
|
4357
4368
|
const protocol = extractProtocol(url);
|
|
4358
4369
|
const { host, port } = extractHostAndPort(url);
|
|
4359
4370
|
const portStr = port === null ? '' : `:${port}`;
|
|
@@ -4679,7 +4690,7 @@ class EmailAuthCredential extends AuthCredential {
|
|
|
4679
4690
|
*/
|
|
4680
4691
|
static fromJSON(json) {
|
|
4681
4692
|
const obj = typeof json === 'string' ? JSON.parse(json) : json;
|
|
4682
|
-
if (
|
|
4693
|
+
if (obj?.email && obj?.password) {
|
|
4683
4694
|
if (obj.signInMethod === "password" /* SignInMethod.EMAIL_PASSWORD */) {
|
|
4684
4695
|
return this._fromEmailAndPassword(obj.email, obj.password);
|
|
4685
4696
|
}
|
|
@@ -4839,7 +4850,7 @@ class OAuthCredential extends AuthCredential {
|
|
|
4839
4850
|
*/
|
|
4840
4851
|
static fromJSON(json) {
|
|
4841
4852
|
const obj = typeof json === 'string' ? JSON.parse(json) : json;
|
|
4842
|
-
const { providerId, signInMethod
|
|
4853
|
+
const { providerId, signInMethod, ...rest } = obj;
|
|
4843
4854
|
if (!providerId || !signInMethod) {
|
|
4844
4855
|
return null;
|
|
4845
4856
|
}
|
|
@@ -4930,7 +4941,10 @@ const VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_ = {
|
|
|
4930
4941
|
["USER_NOT_FOUND" /* ServerError.USER_NOT_FOUND */]: "user-not-found" /* AuthErrorCode.USER_DELETED */
|
|
4931
4942
|
};
|
|
4932
4943
|
async function verifyPhoneNumberForExisting(auth, request) {
|
|
4933
|
-
const apiRequest =
|
|
4944
|
+
const apiRequest = {
|
|
4945
|
+
...request,
|
|
4946
|
+
operation: 'REAUTH'
|
|
4947
|
+
};
|
|
4934
4948
|
return _performSignInRequest(auth, "POST" /* HttpMethod.POST */, "/v1/accounts:signInWithPhoneNumber" /* Endpoint.SIGN_IN_WITH_PHONE_NUMBER */, _addTidIfNecessary(auth, apiRequest), VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_);
|
|
4935
4949
|
}
|
|
4936
4950
|
|
|
@@ -4974,7 +4988,10 @@ class PhoneAuthCredential extends AuthCredential {
|
|
|
4974
4988
|
}
|
|
4975
4989
|
/** @internal */
|
|
4976
4990
|
_linkToIdToken(auth, idToken) {
|
|
4977
|
-
return linkWithPhoneNumber(auth,
|
|
4991
|
+
return linkWithPhoneNumber(auth, {
|
|
4992
|
+
idToken,
|
|
4993
|
+
...this._makeVerificationRequest()
|
|
4994
|
+
});
|
|
4978
4995
|
}
|
|
4979
4996
|
/** @internal */
|
|
4980
4997
|
_getReauthenticationResolver(auth) {
|
|
@@ -5102,19 +5119,18 @@ class ActionCodeURL {
|
|
|
5102
5119
|
* @internal
|
|
5103
5120
|
*/
|
|
5104
5121
|
constructor(actionLink) {
|
|
5105
|
-
var _a, _b, _c, _d, _e, _f;
|
|
5106
5122
|
const searchParams = querystringDecode(extractQuerystring(actionLink));
|
|
5107
|
-
const apiKey =
|
|
5108
|
-
const code =
|
|
5109
|
-
const operation = parseMode(
|
|
5123
|
+
const apiKey = searchParams["apiKey" /* QueryField.API_KEY */] ?? null;
|
|
5124
|
+
const code = searchParams["oobCode" /* QueryField.CODE */] ?? null;
|
|
5125
|
+
const operation = parseMode(searchParams["mode" /* QueryField.MODE */] ?? null);
|
|
5110
5126
|
// Validate API key, code and mode.
|
|
5111
5127
|
_assert(apiKey && code && operation, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
5112
5128
|
this.apiKey = apiKey;
|
|
5113
5129
|
this.operation = operation;
|
|
5114
5130
|
this.code = code;
|
|
5115
|
-
this.continueUrl =
|
|
5116
|
-
this.languageCode =
|
|
5117
|
-
this.tenantId =
|
|
5131
|
+
this.continueUrl = searchParams["continueUrl" /* QueryField.CONTINUE_URL */] ?? null;
|
|
5132
|
+
this.languageCode = searchParams["lang" /* QueryField.LANGUAGE_CODE */] ?? null;
|
|
5133
|
+
this.tenantId = searchParams["tenantId" /* QueryField.TENANT_ID */] ?? null;
|
|
5118
5134
|
}
|
|
5119
5135
|
/**
|
|
5120
5136
|
* Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,
|
|
@@ -5130,7 +5146,7 @@ class ActionCodeURL {
|
|
|
5130
5146
|
try {
|
|
5131
5147
|
return new ActionCodeURL(actionLink);
|
|
5132
5148
|
}
|
|
5133
|
-
catch
|
|
5149
|
+
catch {
|
|
5134
5150
|
return null;
|
|
5135
5151
|
}
|
|
5136
5152
|
}
|
|
@@ -5420,13 +5436,17 @@ class OAuthProvider extends BaseOAuthProvider {
|
|
|
5420
5436
|
* or the ID token string.
|
|
5421
5437
|
*/
|
|
5422
5438
|
credential(params) {
|
|
5423
|
-
return this._credential(
|
|
5439
|
+
return this._credential({ ...params, nonce: params.rawNonce });
|
|
5424
5440
|
}
|
|
5425
5441
|
/** An internal credential method that accepts more permissive options */
|
|
5426
5442
|
_credential(params) {
|
|
5427
5443
|
_assert(params.idToken || params.accessToken, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
5428
5444
|
// For OAuthCredential, sign in method is same as providerId.
|
|
5429
|
-
return OAuthCredential._fromParams(
|
|
5445
|
+
return OAuthCredential._fromParams({
|
|
5446
|
+
...params,
|
|
5447
|
+
providerId: this.providerId,
|
|
5448
|
+
signInMethod: this.providerId
|
|
5449
|
+
});
|
|
5430
5450
|
}
|
|
5431
5451
|
/**
|
|
5432
5452
|
* Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.
|
|
@@ -5578,7 +5598,7 @@ class FacebookAuthProvider extends BaseOAuthProvider {
|
|
|
5578
5598
|
try {
|
|
5579
5599
|
return FacebookAuthProvider.credential(tokenResponse.oauthAccessToken);
|
|
5580
5600
|
}
|
|
5581
|
-
catch
|
|
5601
|
+
catch {
|
|
5582
5602
|
return null;
|
|
5583
5603
|
}
|
|
5584
5604
|
}
|
|
@@ -5700,7 +5720,7 @@ class GoogleAuthProvider extends BaseOAuthProvider {
|
|
|
5700
5720
|
try {
|
|
5701
5721
|
return GoogleAuthProvider.credential(oauthIdToken, oauthAccessToken);
|
|
5702
5722
|
}
|
|
5703
|
-
catch
|
|
5723
|
+
catch {
|
|
5704
5724
|
return null;
|
|
5705
5725
|
}
|
|
5706
5726
|
}
|
|
@@ -5811,7 +5831,7 @@ class GithubAuthProvider extends BaseOAuthProvider {
|
|
|
5811
5831
|
try {
|
|
5812
5832
|
return GithubAuthProvider.credential(tokenResponse.oauthAccessToken);
|
|
5813
5833
|
}
|
|
5814
|
-
catch
|
|
5834
|
+
catch {
|
|
5815
5835
|
return null;
|
|
5816
5836
|
}
|
|
5817
5837
|
}
|
|
@@ -6095,7 +6115,7 @@ class TwitterAuthProvider extends BaseOAuthProvider {
|
|
|
6095
6115
|
try {
|
|
6096
6116
|
return TwitterAuthProvider.credential(oauthAccessToken, oauthTokenSecret);
|
|
6097
6117
|
}
|
|
6098
|
-
catch
|
|
6118
|
+
catch {
|
|
6099
6119
|
return null;
|
|
6100
6120
|
}
|
|
6101
6121
|
}
|
|
@@ -6211,13 +6231,12 @@ function providerIdForResponse(response) {
|
|
|
6211
6231
|
* @public
|
|
6212
6232
|
*/
|
|
6213
6233
|
async function signInAnonymously(auth) {
|
|
6214
|
-
var _a;
|
|
6215
6234
|
if (_isFirebaseServerApp(auth.app)) {
|
|
6216
6235
|
return Promise.reject(_serverAppCurrentUserOperationNotSupportedError(auth));
|
|
6217
6236
|
}
|
|
6218
6237
|
const authInternal = _castAuth(auth);
|
|
6219
6238
|
await authInternal._initializationPromise;
|
|
6220
|
-
if (
|
|
6239
|
+
if (authInternal.currentUser?.isAnonymous) {
|
|
6221
6240
|
// If an anonymous user is already signed in, no need to sign them in again.
|
|
6222
6241
|
return new UserCredentialImpl({
|
|
6223
6242
|
user: authInternal.currentUser,
|
|
@@ -6251,7 +6270,6 @@ async function signInAnonymously(auth) {
|
|
|
6251
6270
|
*/
|
|
6252
6271
|
class MultiFactorError extends FirebaseError {
|
|
6253
6272
|
constructor(auth, error, operationType, user) {
|
|
6254
|
-
var _a;
|
|
6255
6273
|
super(error.code, error.message);
|
|
6256
6274
|
this.operationType = operationType;
|
|
6257
6275
|
this.user = user;
|
|
@@ -6259,7 +6277,7 @@ class MultiFactorError extends FirebaseError {
|
|
|
6259
6277
|
Object.setPrototypeOf(this, MultiFactorError.prototype);
|
|
6260
6278
|
this.customData = {
|
|
6261
6279
|
appName: auth.name,
|
|
6262
|
-
tenantId:
|
|
6280
|
+
tenantId: auth.tenantId ?? undefined,
|
|
6263
6281
|
_serverResponse: error.customData._serverResponse,
|
|
6264
6282
|
operationType
|
|
6265
6283
|
};
|
|
@@ -6390,7 +6408,7 @@ async function _reauthenticate(user, credential, bypassAuthState = false) {
|
|
|
6390
6408
|
}
|
|
6391
6409
|
catch (e) {
|
|
6392
6410
|
// Convert user deleted error into user mismatch
|
|
6393
|
-
if (
|
|
6411
|
+
if (e?.code === `auth/${"user-not-found" /* AuthErrorCode.USER_DELETED */}`) {
|
|
6394
6412
|
_fail(auth, "user-mismatch" /* AuthErrorCode.USER_MISMATCH */);
|
|
6395
6413
|
}
|
|
6396
6414
|
throw e;
|
|
@@ -6615,8 +6633,7 @@ class TotpMultiFactorInfoImpl extends MultiFactorInfoImpl {
|
|
|
6615
6633
|
* limitations under the License.
|
|
6616
6634
|
*/
|
|
6617
6635
|
function _setActionCodeSettingsOnRequest(auth, request, actionCodeSettings) {
|
|
6618
|
-
|
|
6619
|
-
_assert(((_a = actionCodeSettings.url) === null || _a === void 0 ? void 0 : _a.length) > 0, auth, "invalid-continue-uri" /* AuthErrorCode.INVALID_CONTINUE_URI */);
|
|
6636
|
+
_assert(actionCodeSettings.url?.length > 0, auth, "invalid-continue-uri" /* AuthErrorCode.INVALID_CONTINUE_URI */);
|
|
6620
6637
|
_assert(typeof actionCodeSettings.dynamicLinkDomain === 'undefined' ||
|
|
6621
6638
|
actionCodeSettings.dynamicLinkDomain.length > 0, auth, "invalid-dynamic-link-domain" /* AuthErrorCode.INVALID_DYNAMIC_LINK_DOMAIN */);
|
|
6622
6639
|
_assert(typeof actionCodeSettings.linkDomain === 'undefined' ||
|
|
@@ -6977,7 +6994,7 @@ async function sendSignInLinkToEmail(auth, email, actionCodeSettings) {
|
|
|
6977
6994
|
*/
|
|
6978
6995
|
function isSignInWithEmailLink(auth, emailLink) {
|
|
6979
6996
|
const actionCodeUrl = ActionCodeURL.parseLink(emailLink);
|
|
6980
|
-
return
|
|
6997
|
+
return actionCodeUrl?.operation === "EMAIL_SIGNIN" /* ActionCodeOperation.EMAIL_SIGNIN */;
|
|
6981
6998
|
}
|
|
6982
6999
|
/**
|
|
6983
7000
|
* Asynchronously signs in using an email and sign-in email link.
|
|
@@ -7350,7 +7367,6 @@ async function updateEmailOrPassword(user, email, password) {
|
|
|
7350
7367
|
*
|
|
7351
7368
|
*/
|
|
7352
7369
|
function _fromIdTokenResponse(idTokenResponse) {
|
|
7353
|
-
var _a, _b;
|
|
7354
7370
|
if (!idTokenResponse) {
|
|
7355
7371
|
return null;
|
|
7356
7372
|
}
|
|
@@ -7360,8 +7376,8 @@ function _fromIdTokenResponse(idTokenResponse) {
|
|
|
7360
7376
|
: {};
|
|
7361
7377
|
const isNewUser = idTokenResponse.isNewUser ||
|
|
7362
7378
|
idTokenResponse.kind === "identitytoolkit#SignupNewUserResponse" /* IdTokenResponseKind.SignupNewUser */;
|
|
7363
|
-
if (!providerId &&
|
|
7364
|
-
const signInProvider =
|
|
7379
|
+
if (!providerId && idTokenResponse?.idToken) {
|
|
7380
|
+
const signInProvider = _parseToken(idTokenResponse.idToken)?.firebase?.['sign_in_provider'];
|
|
7365
7381
|
if (signInProvider) {
|
|
7366
7382
|
const filteredProviderId = signInProvider !== "anonymous" /* ProviderId.ANONYMOUS */ &&
|
|
7367
7383
|
signInProvider !== "custom" /* ProviderId.CUSTOM */
|
|
@@ -7410,7 +7426,7 @@ class FacebookAdditionalUserInfo extends GenericAdditionalUserInfo {
|
|
|
7410
7426
|
}
|
|
7411
7427
|
class GithubAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername {
|
|
7412
7428
|
constructor(isNewUser, profile) {
|
|
7413
|
-
super(isNewUser, "github.com" /* ProviderId.GITHUB */, profile, typeof
|
|
7429
|
+
super(isNewUser, "github.com" /* ProviderId.GITHUB */, profile, typeof profile?.login === 'string' ? profile?.login : null);
|
|
7414
7430
|
}
|
|
7415
7431
|
}
|
|
7416
7432
|
class GoogleAdditionalUserInfo extends GenericAdditionalUserInfo {
|
|
@@ -7710,12 +7726,11 @@ class MultiFactorSessionImpl {
|
|
|
7710
7726
|
};
|
|
7711
7727
|
}
|
|
7712
7728
|
static fromJSON(obj) {
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
if ((_a = obj.multiFactorSession) === null || _a === void 0 ? void 0 : _a.pendingCredential) {
|
|
7729
|
+
if (obj?.multiFactorSession) {
|
|
7730
|
+
if (obj.multiFactorSession?.pendingCredential) {
|
|
7716
7731
|
return MultiFactorSessionImpl._fromMfaPendingCredential(obj.multiFactorSession.pendingCredential);
|
|
7717
7732
|
}
|
|
7718
|
-
else if (
|
|
7733
|
+
else if (obj.multiFactorSession?.idToken) {
|
|
7719
7734
|
return MultiFactorSessionImpl._fromIdtoken(obj.multiFactorSession.idToken);
|
|
7720
7735
|
}
|
|
7721
7736
|
}
|
|
@@ -7758,7 +7773,11 @@ class MultiFactorResolverImpl {
|
|
|
7758
7773
|
delete serverResponse.mfaInfo;
|
|
7759
7774
|
delete serverResponse.mfaPendingCredential;
|
|
7760
7775
|
// Use in the new token & refresh token in the old response
|
|
7761
|
-
const idTokenResponse =
|
|
7776
|
+
const idTokenResponse = {
|
|
7777
|
+
...serverResponse,
|
|
7778
|
+
idToken: mfaResponse.idToken,
|
|
7779
|
+
refreshToken: mfaResponse.refreshToken
|
|
7780
|
+
};
|
|
7762
7781
|
// TODO: we should collapse this switch statement into UserCredentialImpl._forOperation and have it support the SIGN_IN case
|
|
7763
7782
|
switch (error.operationType) {
|
|
7764
7783
|
case "signIn" /* OperationType.SIGN_IN */:
|
|
@@ -7789,11 +7808,10 @@ class MultiFactorResolverImpl {
|
|
|
7789
7808
|
* @public
|
|
7790
7809
|
*/
|
|
7791
7810
|
function getMultiFactorResolver(auth, error) {
|
|
7792
|
-
var _a;
|
|
7793
7811
|
const authModular = getModularInstance(auth);
|
|
7794
7812
|
const errorInternal = error;
|
|
7795
7813
|
_assert(error.customData.operationType, authModular, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
7796
|
-
_assert(
|
|
7814
|
+
_assert(errorInternal.customData._serverResponse?.mfaPendingCredential, authModular, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
7797
7815
|
return MultiFactorResolverImpl._fromError(authModular, errorInternal);
|
|
7798
7816
|
}
|
|
7799
7817
|
|
|
@@ -7899,7 +7917,7 @@ function multiFactor(user) {
|
|
|
7899
7917
|
}
|
|
7900
7918
|
|
|
7901
7919
|
var name = "@firebase/auth";
|
|
7902
|
-
var version = "1.10.
|
|
7920
|
+
var version = "1.10.8-canary.25b60fdaa";
|
|
7903
7921
|
|
|
7904
7922
|
/**
|
|
7905
7923
|
* @license
|
|
@@ -7923,9 +7941,8 @@ class AuthInterop {
|
|
|
7923
7941
|
this.internalListeners = new Map();
|
|
7924
7942
|
}
|
|
7925
7943
|
getUid() {
|
|
7926
|
-
var _a;
|
|
7927
7944
|
this.assertAuthConfigured();
|
|
7928
|
-
return
|
|
7945
|
+
return this.auth.currentUser?.uid || null;
|
|
7929
7946
|
}
|
|
7930
7947
|
async getToken(forceRefresh) {
|
|
7931
7948
|
this.assertAuthConfigured();
|
|
@@ -7942,7 +7959,7 @@ class AuthInterop {
|
|
|
7942
7959
|
return;
|
|
7943
7960
|
}
|
|
7944
7961
|
const unsubscribe = this.auth.onIdTokenChanged(user => {
|
|
7945
|
-
listener(
|
|
7962
|
+
listener(user?.stsTokenManager.accessToken || null);
|
|
7946
7963
|
});
|
|
7947
7964
|
this.internalListeners.set(listener, unsubscribe);
|
|
7948
7965
|
this.updateProactiveRefresh();
|
|
@@ -8041,8 +8058,8 @@ function registerAuth(clientPlatform) {
|
|
|
8041
8058
|
return (auth => new AuthInterop(auth))(auth);
|
|
8042
8059
|
}, "PRIVATE" /* ComponentType.PRIVATE */).setInstantiationMode("EXPLICIT" /* InstantiationMode.EXPLICIT */));
|
|
8043
8060
|
registerVersion(name, version, getVersionForPlatform(clientPlatform));
|
|
8044
|
-
// BUILD_TARGET will be replaced by values like
|
|
8045
|
-
registerVersion(name, version, '
|
|
8061
|
+
// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation
|
|
8062
|
+
registerVersion(name, version, 'esm2020');
|
|
8046
8063
|
}
|
|
8047
8064
|
|
|
8048
8065
|
/**
|
|
@@ -8177,7 +8194,7 @@ class BrowserPersistenceClass {
|
|
|
8177
8194
|
this.storage.removeItem(STORAGE_AVAILABLE_KEY);
|
|
8178
8195
|
return Promise.resolve(true);
|
|
8179
8196
|
}
|
|
8180
|
-
catch
|
|
8197
|
+
catch {
|
|
8181
8198
|
return Promise.resolve(false);
|
|
8182
8199
|
}
|
|
8183
8200
|
}
|
|
@@ -9112,7 +9129,6 @@ const REDIRECT_TIMEOUT_MS = 2000;
|
|
|
9112
9129
|
* Generates the URL for the OAuth handler.
|
|
9113
9130
|
*/
|
|
9114
9131
|
async function _generateHandlerUrl(auth, event, provider) {
|
|
9115
|
-
var _a;
|
|
9116
9132
|
// Get the cordova plugins
|
|
9117
9133
|
const { BuildInfo } = _cordovaWindow();
|
|
9118
9134
|
debugAssert(event.sessionId, 'AuthEvent did not contain a session ID');
|
|
@@ -9135,7 +9151,7 @@ async function _generateHandlerUrl(auth, event, provider) {
|
|
|
9135
9151
|
}
|
|
9136
9152
|
// Attached the hashed session ID
|
|
9137
9153
|
additionalParams['sessionId'] = sessionDigest;
|
|
9138
|
-
return _getRedirectUrl(auth, provider, event.type, undefined,
|
|
9154
|
+
return _getRedirectUrl(auth, provider, event.type, undefined, event.eventId ?? undefined, additionalParams);
|
|
9139
9155
|
}
|
|
9140
9156
|
/**
|
|
9141
9157
|
* Validates that this app is valid for this project configuration
|
|
@@ -9187,17 +9203,16 @@ async function _waitForAppResume(auth, eventListener, iabRef) {
|
|
|
9187
9203
|
let onCloseTimer = null;
|
|
9188
9204
|
// DEFINE ALL THE CALLBACKS =====
|
|
9189
9205
|
function authEventSeen() {
|
|
9190
|
-
var _a;
|
|
9191
9206
|
// Auth event was detected. Resolve this promise and close the extra
|
|
9192
9207
|
// window if it's still open.
|
|
9193
9208
|
resolve();
|
|
9194
|
-
const closeBrowserTab =
|
|
9209
|
+
const closeBrowserTab = cordova.plugins.browsertab?.close;
|
|
9195
9210
|
if (typeof closeBrowserTab === 'function') {
|
|
9196
9211
|
closeBrowserTab();
|
|
9197
9212
|
}
|
|
9198
9213
|
// Close inappbrowser embedded webview in iOS7 and 8 case if still
|
|
9199
9214
|
// open.
|
|
9200
|
-
if (typeof
|
|
9215
|
+
if (typeof iabRef?.close === 'function') {
|
|
9201
9216
|
iabRef.close();
|
|
9202
9217
|
}
|
|
9203
9218
|
}
|
|
@@ -9212,7 +9227,7 @@ async function _waitForAppResume(auth, eventListener, iabRef) {
|
|
|
9212
9227
|
}, REDIRECT_TIMEOUT_MS);
|
|
9213
9228
|
}
|
|
9214
9229
|
function visibilityChanged() {
|
|
9215
|
-
if (
|
|
9230
|
+
if (document?.visibilityState === 'visible') {
|
|
9216
9231
|
resumed();
|
|
9217
9232
|
}
|
|
9218
9233
|
}
|
|
@@ -9245,29 +9260,28 @@ async function _waitForAppResume(auth, eventListener, iabRef) {
|
|
|
9245
9260
|
* missing plugin.
|
|
9246
9261
|
*/
|
|
9247
9262
|
function _checkCordovaConfiguration(auth) {
|
|
9248
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
9249
9263
|
const win = _cordovaWindow();
|
|
9250
9264
|
// Check all dependencies installed.
|
|
9251
9265
|
// https://github.com/nordnet/cordova-universal-links-plugin
|
|
9252
9266
|
// Note that cordova-universal-links-plugin has been abandoned.
|
|
9253
9267
|
// A fork with latest fixes is available at:
|
|
9254
9268
|
// https://www.npmjs.com/package/cordova-universal-links-plugin-fix
|
|
9255
|
-
_assert(typeof
|
|
9269
|
+
_assert(typeof win?.universalLinks?.subscribe === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
9256
9270
|
missingPlugin: 'cordova-universal-links-plugin-fix'
|
|
9257
9271
|
});
|
|
9258
9272
|
// https://www.npmjs.com/package/cordova-plugin-buildinfo
|
|
9259
|
-
_assert(typeof
|
|
9273
|
+
_assert(typeof win?.BuildInfo?.packageName !== 'undefined', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
9260
9274
|
missingPlugin: 'cordova-plugin-buildInfo'
|
|
9261
9275
|
});
|
|
9262
9276
|
// https://github.com/google/cordova-plugin-browsertab
|
|
9263
|
-
_assert(typeof
|
|
9277
|
+
_assert(typeof win?.cordova?.plugins?.browsertab?.openUrl === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
9264
9278
|
missingPlugin: 'cordova-plugin-browsertab'
|
|
9265
9279
|
});
|
|
9266
|
-
_assert(typeof
|
|
9280
|
+
_assert(typeof win?.cordova?.plugins?.browsertab?.isAvailable === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
9267
9281
|
missingPlugin: 'cordova-plugin-browsertab'
|
|
9268
9282
|
});
|
|
9269
9283
|
// https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/
|
|
9270
|
-
_assert(typeof
|
|
9284
|
+
_assert(typeof win?.cordova?.InAppBrowser?.open === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
|
|
9271
9285
|
missingPlugin: 'cordova-plugin-inappbrowser'
|
|
9272
9286
|
});
|
|
9273
9287
|
}
|
|
@@ -9368,9 +9382,8 @@ class AuthEventManager {
|
|
|
9368
9382
|
return handled;
|
|
9369
9383
|
}
|
|
9370
9384
|
sendToConsumer(event, consumer) {
|
|
9371
|
-
var _a;
|
|
9372
9385
|
if (event.error && !isNullRedirectEvent(event)) {
|
|
9373
|
-
const code =
|
|
9386
|
+
const code = event.error.code?.split('auth/')[1] ||
|
|
9374
9387
|
"internal-error" /* AuthErrorCode.INTERNAL_ERROR */;
|
|
9375
9388
|
consumer.onError(_createError(this.auth, code));
|
|
9376
9389
|
}
|
|
@@ -9400,7 +9413,7 @@ function eventUid(e) {
|
|
|
9400
9413
|
}
|
|
9401
9414
|
function isNullRedirectEvent({ type, error }) {
|
|
9402
9415
|
return (type === "unknown" /* AuthEventType.UNKNOWN */ &&
|
|
9403
|
-
|
|
9416
|
+
error?.code === `auth/${"no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */}`);
|
|
9404
9417
|
}
|
|
9405
9418
|
function isRedirectEvent(event) {
|
|
9406
9419
|
switch (event.type) {
|
|
@@ -9488,7 +9501,6 @@ async function _getAndRemoveEvent(auth) {
|
|
|
9488
9501
|
return event;
|
|
9489
9502
|
}
|
|
9490
9503
|
function _eventFromPartialAndUrl(partialEvent, url) {
|
|
9491
|
-
var _a, _b;
|
|
9492
9504
|
// Parse the deep link within the dynamic link URL.
|
|
9493
9505
|
const callbackUrl = _getDeepLinkFromCallback(url);
|
|
9494
9506
|
// Confirm it is actually a callback URL.
|
|
@@ -9505,7 +9517,7 @@ function _eventFromPartialAndUrl(partialEvent, url) {
|
|
|
9505
9517
|
const errorObject = params['firebaseError']
|
|
9506
9518
|
? parseJsonOrNull(decodeURIComponent(params['firebaseError']))
|
|
9507
9519
|
: null;
|
|
9508
|
-
const code =
|
|
9520
|
+
const code = errorObject?.['code']?.split('auth/')?.[1];
|
|
9509
9521
|
const error = code ? _createError(code) : null;
|
|
9510
9522
|
if (error) {
|
|
9511
9523
|
return {
|
|
@@ -9572,7 +9584,7 @@ function _getDeepLinkFromCallback(url) {
|
|
|
9572
9584
|
* empty search params object.
|
|
9573
9585
|
*/
|
|
9574
9586
|
function searchParamsOrEmpty(url) {
|
|
9575
|
-
if (!
|
|
9587
|
+
if (!url?.includes('?')) {
|
|
9576
9588
|
return {};
|
|
9577
9589
|
}
|
|
9578
9590
|
const [_, ...rest] = url.split('?');
|
|
@@ -9662,7 +9674,7 @@ class CordovaPopupRedirectResolver {
|
|
|
9662
9674
|
clearTimeout(noEventTimeout);
|
|
9663
9675
|
const partialEvent = await _getAndRemoveEvent(auth);
|
|
9664
9676
|
let finalEvent = null;
|
|
9665
|
-
if (partialEvent &&
|
|
9677
|
+
if (partialEvent && eventData?.['url']) {
|
|
9666
9678
|
finalEvent = _eventFromPartialAndUrl(partialEvent, eventData['url']);
|
|
9667
9679
|
}
|
|
9668
9680
|
// If finalEvent is never filled, trigger with no event
|
|
@@ -9719,4 +9731,4 @@ function generateNoEvent() {
|
|
|
9719
9731
|
}
|
|
9720
9732
|
|
|
9721
9733
|
export { signInWithEmailAndPassword as $, ActionCodeOperation as A, PhoneAuthCredential as B, inMemoryPersistence as C, EmailAuthProvider as D, EmailAuthCredential as E, FactorId as F, FacebookAuthProvider as G, GoogleAuthProvider as H, GithubAuthProvider as I, OAuthProvider as J, SAMLAuthProvider as K, signInAnonymously as L, signInWithCredential as M, linkWithCredential as N, OperationType as O, ProviderId as P, reauthenticateWithCredential as Q, signInWithCustomToken as R, SignInMethod as S, TwitterAuthProvider as T, sendPasswordResetEmail as U, confirmPasswordReset as V, applyActionCode as W, checkActionCode as X, verifyPasswordResetCode as Y, createUserWithEmailAndPassword as Z, _signInWithRedirect as _, _reauthenticateWithRedirect as a, debugFail as a$, sendSignInLinkToEmail as a0, isSignInWithEmailLink as a1, signInWithEmailLink as a2, fetchSignInMethodsForEmail as a3, sendEmailVerification as a4, verifyBeforeUpdateEmail as a5, ActionCodeURL as a6, parseActionCodeURL as a7, updateProfile as a8, updateEmail as a9, FAKE_TOKEN as aA, startEnrollPhoneMfa as aB, handleRecaptchaFlow as aC, sendPhoneVerificationCode as aD, _link$1 as aE, _assertInstanceOf as aF, _withDefaultResolver as aG, AbstractPopupRedirectOperation as aH, debugAssert as aI, _generateEventId as aJ, FederatedAuthProvider as aK, _getProjectConfig as aL, _fail as aM, _getCurrentUrl as aN, _gapiScriptUrl as aO, _emulatorUrl as aP, _isChromeIOS as aQ, _isFirefox as aR, _isIOSStandalone as aS, _getRedirectResult as aT, _overrideRedirectResult as aU, _getRedirectUrl as aV, _setWindowLocation as aW, _isMobileBrowser as aX, _isSafari as aY, _isIOS as aZ, AuthEventManager as a_, updatePassword as aa, getIdToken as ab, getIdTokenResult as ac, unlink as ad, getAdditionalUserInfo as ae, reload as af, getMultiFactorResolver as ag, multiFactor as ah, _performApiRequest as ai, _addTidIfNecessary as aj, Delay as ak, _window as al, _assert as am, isV2 as an, _createError as ao, _recaptchaV2ScriptUrl as ap, _loadJS as aq, MockReCaptcha as ar, _generateCallbackName as as, _castAuth as at, _isHttpOrHttps as au, _isWorker as av, getRecaptchaParams as aw, _serverAppCurrentUserOperationNotSupportedError as ax, _assertLinkedStatus as ay, _initializeRecaptchaConfig as az, _linkWithRedirect as b, finalizeEnrollPhoneMfa as b0, startEnrollTotpMfa as b1, finalizeEnrollTotpMfa as b2, _setExternalJSProvider as b3, _persistenceKeyName as b4, UserImpl as b5, _getInstance as b6, AuthImpl as b7, _getClientVersion as b8, FetchProvider as b9, SAMLAuthCredential as ba, signInWithRedirect as bb, linkWithRedirect as bc, reauthenticateWithRedirect as bd, indexedDBLocalPersistence as c, cordovaPopupRedirectResolver as d, browserLocalPersistence as e, browserSessionPersistence as f, getRedirectResult as g, initializeRecaptchaConfig as h, initializeAuth as i, beforeAuthStateChanged as j, onAuthStateChanged as k, updateCurrentUser as l, signOut as m, revokeAccessToken as n, onIdTokenChanged as o, deleteUser as p, debugErrorMap as q, registerAuth as r, setPersistence as s, prodErrorMap as t, useDeviceLanguage as u, validatePassword as v, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as w, connectAuthEmulator as x, AuthCredential as y, OAuthCredential as z };
|
|
9722
|
-
//# sourceMappingURL=popup_redirect-
|
|
9734
|
+
//# sourceMappingURL=popup_redirect-6226898d.js.map
|