@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
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var app = require('@firebase/app');
|
|
4
4
|
var util = require('@firebase/util');
|
|
5
|
-
var tslib = require('tslib');
|
|
6
5
|
var component = require('@firebase/component');
|
|
7
6
|
var logger = require('@firebase/logger');
|
|
8
7
|
|
|
@@ -479,7 +478,10 @@ function _createError(authOrCode, ...rest) {
|
|
|
479
478
|
return createErrorInternal(authOrCode, ...rest);
|
|
480
479
|
}
|
|
481
480
|
function _errorWithCustomMessage(auth, code, message) {
|
|
482
|
-
const errorMap =
|
|
481
|
+
const errorMap = {
|
|
482
|
+
...prodErrorMap(),
|
|
483
|
+
[code]: message
|
|
484
|
+
};
|
|
483
485
|
const factory = new util.ErrorFactory('auth', 'Firebase', errorMap);
|
|
484
486
|
return factory.create(code, {
|
|
485
487
|
appName: auth.name
|
|
@@ -550,15 +552,13 @@ function debugAssert(assertion, message) {
|
|
|
550
552
|
* limitations under the License.
|
|
551
553
|
*/
|
|
552
554
|
function _getCurrentUrl() {
|
|
553
|
-
|
|
554
|
-
return (typeof self !== 'undefined' && ((_a = self.location) === null || _a === void 0 ? void 0 : _a.href)) || '';
|
|
555
|
+
return (typeof self !== 'undefined' && self.location?.href) || '';
|
|
555
556
|
}
|
|
556
557
|
function _isHttpOrHttps() {
|
|
557
558
|
return _getCurrentScheme() === 'http:' || _getCurrentScheme() === 'https:';
|
|
558
559
|
}
|
|
559
560
|
function _getCurrentScheme() {
|
|
560
|
-
|
|
561
|
-
return (typeof self !== 'undefined' && ((_a = self.location) === null || _a === void 0 ? void 0 : _a.protocol)) || null;
|
|
561
|
+
return (typeof self !== 'undefined' && self.location?.protocol) || null;
|
|
562
562
|
}
|
|
563
563
|
|
|
564
564
|
/**
|
|
@@ -872,7 +872,10 @@ const CookieAuthProxiedEndpoints = [
|
|
|
872
872
|
const DEFAULT_API_TIMEOUT_MS = new Delay(30000, 60000);
|
|
873
873
|
function _addTidIfNecessary(auth, request) {
|
|
874
874
|
if (auth.tenantId && !request.tenantId) {
|
|
875
|
-
return
|
|
875
|
+
return {
|
|
876
|
+
...request,
|
|
877
|
+
tenantId: auth.tenantId
|
|
878
|
+
};
|
|
876
879
|
}
|
|
877
880
|
return request;
|
|
878
881
|
}
|
|
@@ -890,14 +893,20 @@ async function _performApiRequest(auth, method, path, request, customErrorMap =
|
|
|
890
893
|
};
|
|
891
894
|
}
|
|
892
895
|
}
|
|
893
|
-
const query = util.querystring(
|
|
896
|
+
const query = util.querystring({
|
|
897
|
+
key: auth.config.apiKey,
|
|
898
|
+
...params
|
|
899
|
+
}).slice(1);
|
|
894
900
|
const headers = await auth._getAdditionalHeaders();
|
|
895
901
|
headers["Content-Type" /* HttpHeader.CONTENT_TYPE */] = 'application/json';
|
|
896
902
|
if (auth.languageCode) {
|
|
897
903
|
headers["X-Firebase-Locale" /* HttpHeader.X_FIREBASE_LOCALE */] = auth.languageCode;
|
|
898
904
|
}
|
|
899
|
-
const fetchArgs =
|
|
900
|
-
|
|
905
|
+
const fetchArgs = {
|
|
906
|
+
method,
|
|
907
|
+
headers,
|
|
908
|
+
...body
|
|
909
|
+
};
|
|
901
910
|
/* Security-conscious server-side frameworks tend to have built in mitigations for referrer
|
|
902
911
|
problems". See the Cloudflare GitHub issue #487: Error: The 'referrerPolicy' field on
|
|
903
912
|
'RequestInitializerDict' is not implemented."
|
|
@@ -913,7 +922,7 @@ async function _performApiRequest(auth, method, path, request, customErrorMap =
|
|
|
913
922
|
}
|
|
914
923
|
async function _performFetchWithErrorHandling(auth, customErrorMap, fetchFn) {
|
|
915
924
|
auth._canInitEmulator = false;
|
|
916
|
-
const errorMap =
|
|
925
|
+
const errorMap = { ...SERVER_ERROR_MAP, ...customErrorMap };
|
|
917
926
|
try {
|
|
918
927
|
const networkTimeout = new NetworkTimeout(auth);
|
|
919
928
|
const response = await Promise.race([
|
|
@@ -1247,7 +1256,7 @@ async function getIdTokenResult(user, forceRefresh = false) {
|
|
|
1247
1256
|
const claims = _parseToken(token);
|
|
1248
1257
|
_assert(claims && claims.exp && claims.auth_time && claims.iat, userInternal.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
1249
1258
|
const firebase = typeof claims.firebase === 'object' ? claims.firebase : undefined;
|
|
1250
|
-
const signInProvider = firebase
|
|
1259
|
+
const signInProvider = firebase?.['sign_in_provider'];
|
|
1251
1260
|
return {
|
|
1252
1261
|
claims,
|
|
1253
1262
|
token,
|
|
@@ -1255,7 +1264,7 @@ async function getIdTokenResult(user, forceRefresh = false) {
|
|
|
1255
1264
|
issuedAtTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.iat)),
|
|
1256
1265
|
expirationTime: utcTimestampToDateString(secondsStringToMilliseconds(claims.exp)),
|
|
1257
1266
|
signInProvider: signInProvider || null,
|
|
1258
|
-
signInSecondFactor:
|
|
1267
|
+
signInSecondFactor: firebase?.['sign_in_second_factor'] || null
|
|
1259
1268
|
};
|
|
1260
1269
|
}
|
|
1261
1270
|
function secondsStringToMilliseconds(seconds) {
|
|
@@ -1278,7 +1287,7 @@ function _parseToken(token) {
|
|
|
1278
1287
|
return JSON.parse(decoded);
|
|
1279
1288
|
}
|
|
1280
1289
|
catch (e) {
|
|
1281
|
-
_logError('Caught error parsing JWT payload as JSON', e
|
|
1290
|
+
_logError('Caught error parsing JWT payload as JSON', e?.toString());
|
|
1282
1291
|
return null;
|
|
1283
1292
|
}
|
|
1284
1293
|
}
|
|
@@ -1374,7 +1383,6 @@ class ProactiveRefresh {
|
|
|
1374
1383
|
}
|
|
1375
1384
|
}
|
|
1376
1385
|
getInterval(wasError) {
|
|
1377
|
-
var _a;
|
|
1378
1386
|
if (wasError) {
|
|
1379
1387
|
const interval = this.errorBackoff;
|
|
1380
1388
|
this.errorBackoff = Math.min(this.errorBackoff * 2, 960000 /* Duration.RETRY_BACKOFF_MAX */);
|
|
@@ -1383,7 +1391,7 @@ class ProactiveRefresh {
|
|
|
1383
1391
|
else {
|
|
1384
1392
|
// Reset the error backoff
|
|
1385
1393
|
this.errorBackoff = 30000 /* Duration.RETRY_BACKOFF_MIN */;
|
|
1386
|
-
const expTime =
|
|
1394
|
+
const expTime = this.user.stsTokenManager.expirationTime ?? 0;
|
|
1387
1395
|
const interval = expTime - Date.now() - 300000 /* Duration.OFFSET */;
|
|
1388
1396
|
return Math.max(0, interval);
|
|
1389
1397
|
}
|
|
@@ -1404,7 +1412,7 @@ class ProactiveRefresh {
|
|
|
1404
1412
|
}
|
|
1405
1413
|
catch (e) {
|
|
1406
1414
|
// Only retry on network errors
|
|
1407
|
-
if (
|
|
1415
|
+
if (e?.code ===
|
|
1408
1416
|
`auth/${"network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */}`) {
|
|
1409
1417
|
this.schedule(/* wasError */ true);
|
|
1410
1418
|
}
|
|
@@ -1470,14 +1478,13 @@ class UserMetadata {
|
|
|
1470
1478
|
* limitations under the License.
|
|
1471
1479
|
*/
|
|
1472
1480
|
async function _reloadWithoutSaving(user) {
|
|
1473
|
-
var _a;
|
|
1474
1481
|
const auth = user.auth;
|
|
1475
1482
|
const idToken = await user.getIdToken();
|
|
1476
1483
|
const response = await _logoutIfInvalidated(user, getAccountInfo(auth, { idToken }));
|
|
1477
|
-
_assert(response
|
|
1484
|
+
_assert(response?.users.length, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
1478
1485
|
const coreAccount = response.users[0];
|
|
1479
1486
|
user._notifyReloadListener(coreAccount);
|
|
1480
|
-
const newProviderData =
|
|
1487
|
+
const newProviderData = coreAccount.providerUserInfo?.length
|
|
1481
1488
|
? extractProviderData(coreAccount.providerUserInfo)
|
|
1482
1489
|
: [];
|
|
1483
1490
|
const providerData = mergeProviderData(user.providerData, newProviderData);
|
|
@@ -1487,7 +1494,7 @@ async function _reloadWithoutSaving(user) {
|
|
|
1487
1494
|
// On the other hand, if it was not anonymous before, it should never be
|
|
1488
1495
|
// considered anonymous now.
|
|
1489
1496
|
const oldIsAnonymous = user.isAnonymous;
|
|
1490
|
-
const newIsAnonymous = !(user.email && coreAccount.passwordHash) && !
|
|
1497
|
+
const newIsAnonymous = !(user.email && coreAccount.passwordHash) && !providerData?.length;
|
|
1491
1498
|
const isAnonymous = !oldIsAnonymous ? false : newIsAnonymous;
|
|
1492
1499
|
const updates = {
|
|
1493
1500
|
uid: coreAccount.localId,
|
|
@@ -1524,8 +1531,7 @@ function mergeProviderData(original, newData) {
|
|
|
1524
1531
|
return [...deduped, ...newData];
|
|
1525
1532
|
}
|
|
1526
1533
|
function extractProviderData(providers) {
|
|
1527
|
-
return providers.map((
|
|
1528
|
-
var { providerId } = _a, provider = tslib.__rest(_a, ["providerId"]);
|
|
1534
|
+
return providers.map(({ providerId, ...provider }) => {
|
|
1529
1535
|
return {
|
|
1530
1536
|
providerId,
|
|
1531
1537
|
uid: provider.rawId || '',
|
|
@@ -1717,8 +1723,7 @@ function assertStringOrUndefined(assertion, appName) {
|
|
|
1717
1723
|
_assert(typeof assertion === 'string' || typeof assertion === 'undefined', "internal-error" /* AuthErrorCode.INTERNAL_ERROR */, { appName });
|
|
1718
1724
|
}
|
|
1719
1725
|
class UserImpl {
|
|
1720
|
-
constructor(
|
|
1721
|
-
var { uid, auth, stsTokenManager } = _a, opt = tslib.__rest(_a, ["uid", "auth", "stsTokenManager"]);
|
|
1726
|
+
constructor({ uid, auth, stsTokenManager, ...opt }) {
|
|
1722
1727
|
// For the user object, provider is always Firebase.
|
|
1723
1728
|
this.providerId = "firebase" /* ProviderId.FIREBASE */;
|
|
1724
1729
|
this.proactiveRefresh = new ProactiveRefresh(this);
|
|
@@ -1766,12 +1771,16 @@ class UserImpl {
|
|
|
1766
1771
|
this.phoneNumber = user.phoneNumber;
|
|
1767
1772
|
this.isAnonymous = user.isAnonymous;
|
|
1768
1773
|
this.tenantId = user.tenantId;
|
|
1769
|
-
this.providerData = user.providerData.map(userInfo => (
|
|
1774
|
+
this.providerData = user.providerData.map(userInfo => ({ ...userInfo }));
|
|
1770
1775
|
this.metadata._copy(user.metadata);
|
|
1771
1776
|
this.stsTokenManager._assign(user.stsTokenManager);
|
|
1772
1777
|
}
|
|
1773
1778
|
_clone(auth) {
|
|
1774
|
-
const newUser = new UserImpl(
|
|
1779
|
+
const newUser = new UserImpl({
|
|
1780
|
+
...this,
|
|
1781
|
+
auth,
|
|
1782
|
+
stsTokenManager: this.stsTokenManager._clone()
|
|
1783
|
+
});
|
|
1775
1784
|
newUser.metadata._copy(this.metadata);
|
|
1776
1785
|
return newUser;
|
|
1777
1786
|
}
|
|
@@ -1826,26 +1835,40 @@ class UserImpl {
|
|
|
1826
1835
|
return this.auth.signOut();
|
|
1827
1836
|
}
|
|
1828
1837
|
toJSON() {
|
|
1829
|
-
return
|
|
1838
|
+
return {
|
|
1839
|
+
uid: this.uid,
|
|
1840
|
+
email: this.email || undefined,
|
|
1841
|
+
emailVerified: this.emailVerified,
|
|
1842
|
+
displayName: this.displayName || undefined,
|
|
1843
|
+
isAnonymous: this.isAnonymous,
|
|
1844
|
+
photoURL: this.photoURL || undefined,
|
|
1845
|
+
phoneNumber: this.phoneNumber || undefined,
|
|
1846
|
+
tenantId: this.tenantId || undefined,
|
|
1847
|
+
providerData: this.providerData.map(userInfo => ({ ...userInfo })),
|
|
1848
|
+
stsTokenManager: this.stsTokenManager.toJSON(),
|
|
1830
1849
|
// Redirect event ID must be maintained in case there is a pending
|
|
1831
1850
|
// redirect event.
|
|
1832
|
-
_redirectEventId: this._redirectEventId
|
|
1851
|
+
_redirectEventId: this._redirectEventId,
|
|
1852
|
+
...this.metadata.toJSON(),
|
|
1833
1853
|
// Required for compatibility with the legacy SDK (go/firebase-auth-sdk-persistence-parsing):
|
|
1834
|
-
apiKey: this.auth.config.apiKey,
|
|
1854
|
+
apiKey: this.auth.config.apiKey,
|
|
1855
|
+
appName: this.auth.name
|
|
1856
|
+
// Missing authDomain will be tolerated by the legacy SDK.
|
|
1857
|
+
// stsTokenManager.apiKey isn't actually required (despite the legacy SDK persisting it).
|
|
1858
|
+
};
|
|
1835
1859
|
}
|
|
1836
1860
|
get refreshToken() {
|
|
1837
1861
|
return this.stsTokenManager.refreshToken || '';
|
|
1838
1862
|
}
|
|
1839
1863
|
static _fromJSON(auth, object) {
|
|
1840
|
-
|
|
1841
|
-
const
|
|
1842
|
-
const
|
|
1843
|
-
const
|
|
1844
|
-
const
|
|
1845
|
-
const
|
|
1846
|
-
const
|
|
1847
|
-
const
|
|
1848
|
-
const lastLoginAt = (_h = object.lastLoginAt) !== null && _h !== void 0 ? _h : undefined;
|
|
1864
|
+
const displayName = object.displayName ?? undefined;
|
|
1865
|
+
const email = object.email ?? undefined;
|
|
1866
|
+
const phoneNumber = object.phoneNumber ?? undefined;
|
|
1867
|
+
const photoURL = object.photoURL ?? undefined;
|
|
1868
|
+
const tenantId = object.tenantId ?? undefined;
|
|
1869
|
+
const _redirectEventId = object._redirectEventId ?? undefined;
|
|
1870
|
+
const createdAt = object.createdAt ?? undefined;
|
|
1871
|
+
const lastLoginAt = object.lastLoginAt ?? undefined;
|
|
1849
1872
|
const { uid, emailVerified, isAnonymous, providerData, stsTokenManager: plainObjectTokenManager } = object;
|
|
1850
1873
|
_assert(uid && plainObjectTokenManager, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
1851
1874
|
const stsTokenManager = StsTokenManager.fromJSON(this.name, plainObjectTokenManager);
|
|
@@ -1875,7 +1898,7 @@ class UserImpl {
|
|
|
1875
1898
|
lastLoginAt
|
|
1876
1899
|
});
|
|
1877
1900
|
if (providerData && Array.isArray(providerData)) {
|
|
1878
|
-
user.providerData = providerData.map(userInfo => (
|
|
1901
|
+
user.providerData = providerData.map(userInfo => ({ ...userInfo }));
|
|
1879
1902
|
}
|
|
1880
1903
|
if (_redirectEventId) {
|
|
1881
1904
|
user._redirectEventId = _redirectEventId;
|
|
@@ -1912,7 +1935,7 @@ class UserImpl {
|
|
|
1912
1935
|
const providerData = coreAccount.providerUserInfo !== undefined
|
|
1913
1936
|
? extractProviderData(coreAccount.providerUserInfo)
|
|
1914
1937
|
: [];
|
|
1915
|
-
const isAnonymous = !(coreAccount.email && coreAccount.passwordHash) && !
|
|
1938
|
+
const isAnonymous = !(coreAccount.email && coreAccount.passwordHash) && !providerData?.length;
|
|
1916
1939
|
const stsTokenManager = new StsTokenManager();
|
|
1917
1940
|
stsTokenManager.updateFromIdToken(idToken);
|
|
1918
1941
|
// Initialize the Firebase Auth user.
|
|
@@ -1934,7 +1957,7 @@ class UserImpl {
|
|
|
1934
1957
|
providerData,
|
|
1935
1958
|
metadata: new UserMetadata(coreAccount.createdAt, coreAccount.lastLoginAt),
|
|
1936
1959
|
isAnonymous: !(coreAccount.email && coreAccount.passwordHash) &&
|
|
1937
|
-
!
|
|
1960
|
+
!providerData?.length
|
|
1938
1961
|
};
|
|
1939
1962
|
Object.assign(user, updates);
|
|
1940
1963
|
return user;
|
|
@@ -2133,7 +2156,7 @@ class PersistenceUserManager {
|
|
|
2133
2156
|
break;
|
|
2134
2157
|
}
|
|
2135
2158
|
}
|
|
2136
|
-
catch
|
|
2159
|
+
catch { }
|
|
2137
2160
|
}
|
|
2138
2161
|
// If we find the user in a persistence that does support migration, use
|
|
2139
2162
|
// that migration path (of only persistences that support migration)
|
|
@@ -2156,7 +2179,7 @@ class PersistenceUserManager {
|
|
|
2156
2179
|
try {
|
|
2157
2180
|
await persistence._remove(key);
|
|
2158
2181
|
}
|
|
2159
|
-
catch
|
|
2182
|
+
catch { }
|
|
2160
2183
|
}
|
|
2161
2184
|
}));
|
|
2162
2185
|
return new PersistenceUserManager(selectedPersistence, auth, userKey);
|
|
@@ -2226,7 +2249,7 @@ function _getBrowserName(userAgent) {
|
|
|
2226
2249
|
// Most modern browsers have name/version at end of user agent string.
|
|
2227
2250
|
const re = /([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/;
|
|
2228
2251
|
const matches = userAgent.match(re);
|
|
2229
|
-
if (
|
|
2252
|
+
if (matches?.length === 2) {
|
|
2230
2253
|
return matches[1];
|
|
2231
2254
|
}
|
|
2232
2255
|
}
|
|
@@ -2394,7 +2417,7 @@ class AuthMiddlewareQueue {
|
|
|
2394
2417
|
}
|
|
2395
2418
|
}
|
|
2396
2419
|
throw this.auth._errorFactory.create("login-blocked" /* AuthErrorCode.LOGIN_BLOCKED */, {
|
|
2397
|
-
originalMessage: e
|
|
2420
|
+
originalMessage: e?.message
|
|
2398
2421
|
});
|
|
2399
2422
|
}
|
|
2400
2423
|
}
|
|
@@ -2452,13 +2475,12 @@ const MINIMUM_MIN_PASSWORD_LENGTH = 6;
|
|
|
2452
2475
|
*/
|
|
2453
2476
|
class PasswordPolicyImpl {
|
|
2454
2477
|
constructor(response) {
|
|
2455
|
-
var _a, _b, _c, _d;
|
|
2456
2478
|
// Only include custom strength options defined in the response.
|
|
2457
2479
|
const responseOptions = response.customStrengthOptions;
|
|
2458
2480
|
this.customStrengthOptions = {};
|
|
2459
2481
|
// TODO: Remove once the backend is updated to include the minimum min password length instead of undefined when there is no minimum length set.
|
|
2460
2482
|
this.customStrengthOptions.minPasswordLength =
|
|
2461
|
-
|
|
2483
|
+
responseOptions.minPasswordLength ?? MINIMUM_MIN_PASSWORD_LENGTH;
|
|
2462
2484
|
if (responseOptions.maxPasswordLength) {
|
|
2463
2485
|
this.customStrengthOptions.maxPasswordLength =
|
|
2464
2486
|
responseOptions.maxPasswordLength;
|
|
@@ -2485,12 +2507,11 @@ class PasswordPolicyImpl {
|
|
|
2485
2507
|
}
|
|
2486
2508
|
// Use an empty string if no non-alphanumeric characters are specified in the response.
|
|
2487
2509
|
this.allowedNonAlphanumericCharacters =
|
|
2488
|
-
|
|
2489
|
-
this.forceUpgradeOnSignin =
|
|
2510
|
+
response.allowedNonAlphanumericCharacters?.join('') ?? '';
|
|
2511
|
+
this.forceUpgradeOnSignin = response.forceUpgradeOnSignin ?? false;
|
|
2490
2512
|
this.schemaVersion = response.schemaVersion;
|
|
2491
2513
|
}
|
|
2492
2514
|
validatePassword(password) {
|
|
2493
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2494
2515
|
const status = {
|
|
2495
2516
|
isValid: true,
|
|
2496
2517
|
passwordPolicy: this
|
|
@@ -2499,12 +2520,12 @@ class PasswordPolicyImpl {
|
|
|
2499
2520
|
this.validatePasswordLengthOptions(password, status);
|
|
2500
2521
|
this.validatePasswordCharacterOptions(password, status);
|
|
2501
2522
|
// Combine the status into single isValid property.
|
|
2502
|
-
status.isValid && (status.isValid =
|
|
2503
|
-
status.isValid && (status.isValid =
|
|
2504
|
-
status.isValid && (status.isValid =
|
|
2505
|
-
status.isValid && (status.isValid =
|
|
2506
|
-
status.isValid && (status.isValid =
|
|
2507
|
-
status.isValid && (status.isValid =
|
|
2523
|
+
status.isValid && (status.isValid = status.meetsMinPasswordLength ?? true);
|
|
2524
|
+
status.isValid && (status.isValid = status.meetsMaxPasswordLength ?? true);
|
|
2525
|
+
status.isValid && (status.isValid = status.containsLowercaseLetter ?? true);
|
|
2526
|
+
status.isValid && (status.isValid = status.containsUppercaseLetter ?? true);
|
|
2527
|
+
status.isValid && (status.isValid = status.containsNumericCharacter ?? true);
|
|
2528
|
+
status.isValid && (status.isValid = status.containsNonAlphanumericCharacter ?? true);
|
|
2508
2529
|
return status;
|
|
2509
2530
|
}
|
|
2510
2531
|
/**
|
|
@@ -2641,18 +2662,17 @@ class AuthImpl {
|
|
|
2641
2662
|
// Have to check for app deletion throughout initialization (after each
|
|
2642
2663
|
// promise resolution)
|
|
2643
2664
|
this._initializationPromise = this.queue(async () => {
|
|
2644
|
-
var _a, _b, _c;
|
|
2645
2665
|
if (this._deleted) {
|
|
2646
2666
|
return;
|
|
2647
2667
|
}
|
|
2648
2668
|
this.persistenceManager = await PersistenceUserManager.create(this, persistenceHierarchy);
|
|
2649
|
-
|
|
2669
|
+
this._resolvePersistenceManagerAvailable?.();
|
|
2650
2670
|
if (this._deleted) {
|
|
2651
2671
|
return;
|
|
2652
2672
|
}
|
|
2653
2673
|
// Initialize the resolver early if necessary (only applicable to web:
|
|
2654
2674
|
// this will cause the iframe to load immediately in certain cases)
|
|
2655
|
-
if (
|
|
2675
|
+
if (this._popupRedirectResolver?._shouldInitProactively) {
|
|
2656
2676
|
// If this fails, don't halt auth loading
|
|
2657
2677
|
try {
|
|
2658
2678
|
await this._popupRedirectResolver._initialize(this);
|
|
@@ -2662,7 +2682,7 @@ class AuthImpl {
|
|
|
2662
2682
|
}
|
|
2663
2683
|
}
|
|
2664
2684
|
await this.initializeCurrentUser(popupRedirectResolver);
|
|
2665
|
-
this.lastNotifiedUid =
|
|
2685
|
+
this.lastNotifiedUid = this.currentUser?.uid || null;
|
|
2666
2686
|
if (this._deleted) {
|
|
2667
2687
|
return;
|
|
2668
2688
|
}
|
|
@@ -2707,7 +2727,6 @@ class AuthImpl {
|
|
|
2707
2727
|
}
|
|
2708
2728
|
}
|
|
2709
2729
|
async initializeCurrentUser(popupRedirectResolver) {
|
|
2710
|
-
var _a;
|
|
2711
2730
|
if (app._isFirebaseServerApp(this.app)) {
|
|
2712
2731
|
const idToken = this.app.settings.authIdToken;
|
|
2713
2732
|
if (idToken) {
|
|
@@ -2727,15 +2746,15 @@ class AuthImpl {
|
|
|
2727
2746
|
let needsTocheckMiddleware = false;
|
|
2728
2747
|
if (popupRedirectResolver && this.config.authDomain) {
|
|
2729
2748
|
await this.getOrInitRedirectPersistenceManager();
|
|
2730
|
-
const redirectUserEventId =
|
|
2731
|
-
const storedUserEventId = futureCurrentUser
|
|
2749
|
+
const redirectUserEventId = this.redirectUser?._redirectEventId;
|
|
2750
|
+
const storedUserEventId = futureCurrentUser?._redirectEventId;
|
|
2732
2751
|
const result = await this.tryRedirectSignIn(popupRedirectResolver);
|
|
2733
2752
|
// If the stored user (i.e. the old "currentUser") has a redirectId that
|
|
2734
2753
|
// matches the redirect user, then we want to initially sign in with the
|
|
2735
2754
|
// new user object from result.
|
|
2736
2755
|
// TODO(samgho): More thoroughly test all of this
|
|
2737
2756
|
if ((!redirectUserEventId || redirectUserEventId === storedUserEventId) &&
|
|
2738
|
-
|
|
2757
|
+
result?.user) {
|
|
2739
2758
|
futureCurrentUser = result.user;
|
|
2740
2759
|
needsTocheckMiddleware = true;
|
|
2741
2760
|
}
|
|
@@ -2810,7 +2829,7 @@ class AuthImpl {
|
|
|
2810
2829
|
await _reloadWithoutSaving(user);
|
|
2811
2830
|
}
|
|
2812
2831
|
catch (e) {
|
|
2813
|
-
if (
|
|
2832
|
+
if (e?.code !==
|
|
2814
2833
|
`auth/${"network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */}`) {
|
|
2815
2834
|
// Something's wrong with the user's token. Log them out and remove
|
|
2816
2835
|
// them from storage
|
|
@@ -2967,12 +2986,11 @@ class AuthImpl {
|
|
|
2967
2986
|
}
|
|
2968
2987
|
}
|
|
2969
2988
|
toJSON() {
|
|
2970
|
-
var _a;
|
|
2971
2989
|
return {
|
|
2972
2990
|
apiKey: this.config.apiKey,
|
|
2973
2991
|
authDomain: this.config.authDomain,
|
|
2974
2992
|
appName: this.name,
|
|
2975
|
-
currentUser:
|
|
2993
|
+
currentUser: this._currentUser?.toJSON()
|
|
2976
2994
|
};
|
|
2977
2995
|
}
|
|
2978
2996
|
async _setRedirectUser(user, popupRedirectResolver) {
|
|
@@ -2993,16 +3011,15 @@ class AuthImpl {
|
|
|
2993
3011
|
return this.redirectPersistenceManager;
|
|
2994
3012
|
}
|
|
2995
3013
|
async _redirectUserForId(id) {
|
|
2996
|
-
var _a, _b;
|
|
2997
3014
|
// Make sure we've cleared any pending persistence actions if we're not in
|
|
2998
3015
|
// the initializer
|
|
2999
3016
|
if (this._isInitialized) {
|
|
3000
3017
|
await this.queue(async () => { });
|
|
3001
3018
|
}
|
|
3002
|
-
if (
|
|
3019
|
+
if (this._currentUser?._redirectEventId === id) {
|
|
3003
3020
|
return this._currentUser;
|
|
3004
3021
|
}
|
|
3005
|
-
if (
|
|
3022
|
+
if (this.redirectUser?._redirectEventId === id) {
|
|
3006
3023
|
return this.redirectUser;
|
|
3007
3024
|
}
|
|
3008
3025
|
return null;
|
|
@@ -3038,12 +3055,11 @@ class AuthImpl {
|
|
|
3038
3055
|
return this.currentUser;
|
|
3039
3056
|
}
|
|
3040
3057
|
notifyAuthListeners() {
|
|
3041
|
-
var _a, _b;
|
|
3042
3058
|
if (!this._isInitialized) {
|
|
3043
3059
|
return;
|
|
3044
3060
|
}
|
|
3045
3061
|
this.idTokenSubscription.next(this.currentUser);
|
|
3046
|
-
const currentUid =
|
|
3062
|
+
const currentUid = this.currentUser?.uid ?? null;
|
|
3047
3063
|
if (this.lastNotifiedUid !== currentUid) {
|
|
3048
3064
|
this.lastNotifiedUid = currentUid;
|
|
3049
3065
|
this.authStateSubscription.next(this.currentUser);
|
|
@@ -3128,7 +3144,6 @@ class AuthImpl {
|
|
|
3128
3144
|
return this.frameworks;
|
|
3129
3145
|
}
|
|
3130
3146
|
async _getAdditionalHeaders() {
|
|
3131
|
-
var _a;
|
|
3132
3147
|
// Additional headers on every request
|
|
3133
3148
|
const headers = {
|
|
3134
3149
|
["X-Client-Version" /* HttpHeader.X_CLIENT_VERSION */]: this.clientVersion
|
|
@@ -3137,10 +3152,11 @@ class AuthImpl {
|
|
|
3137
3152
|
headers["X-Firebase-gmpid" /* HttpHeader.X_FIREBASE_GMPID */] = this.app.options.appId;
|
|
3138
3153
|
}
|
|
3139
3154
|
// If the heartbeat service exists, add the heartbeat string
|
|
3140
|
-
const heartbeatsHeader = await
|
|
3155
|
+
const heartbeatsHeader = await this.heartbeatServiceProvider
|
|
3141
3156
|
.getImmediate({
|
|
3142
3157
|
optional: true
|
|
3143
|
-
})
|
|
3158
|
+
})
|
|
3159
|
+
?.getHeartbeatsHeader();
|
|
3144
3160
|
if (heartbeatsHeader) {
|
|
3145
3161
|
headers["X-Firebase-Client" /* HttpHeader.X_FIREBASE_CLIENT */] = heartbeatsHeader;
|
|
3146
3162
|
}
|
|
@@ -3152,20 +3168,20 @@ class AuthImpl {
|
|
|
3152
3168
|
return headers;
|
|
3153
3169
|
}
|
|
3154
3170
|
async _getAppCheckToken() {
|
|
3155
|
-
var _a;
|
|
3156
3171
|
if (app._isFirebaseServerApp(this.app) && this.app.settings.appCheckToken) {
|
|
3157
3172
|
return this.app.settings.appCheckToken;
|
|
3158
3173
|
}
|
|
3159
|
-
const appCheckTokenResult = await
|
|
3160
|
-
.getImmediate({ optional: true })
|
|
3161
|
-
|
|
3174
|
+
const appCheckTokenResult = await this.appCheckServiceProvider
|
|
3175
|
+
.getImmediate({ optional: true })
|
|
3176
|
+
?.getToken();
|
|
3177
|
+
if (appCheckTokenResult?.error) {
|
|
3162
3178
|
// Context: appCheck.getToken() will never throw even if an error happened.
|
|
3163
3179
|
// In the error case, a dummy token will be returned along with an error field describing
|
|
3164
3180
|
// the error. In general, we shouldn't care about the error condition and just use
|
|
3165
3181
|
// the token (actual or dummy) to send requests.
|
|
3166
3182
|
_logWarn(`Error while retrieving App Check token: ${appCheckTokenResult.error}`);
|
|
3167
3183
|
}
|
|
3168
|
-
return appCheckTokenResult
|
|
3184
|
+
return appCheckTokenResult?.token;
|
|
3169
3185
|
}
|
|
3170
3186
|
}
|
|
3171
3187
|
/**
|
|
@@ -3395,7 +3411,7 @@ async function injectRecaptchaFields(auth, request, action, isCaptchaResp = fals
|
|
|
3395
3411
|
captchaResponse = await verifier.verify(action, true);
|
|
3396
3412
|
}
|
|
3397
3413
|
}
|
|
3398
|
-
const newRequest =
|
|
3414
|
+
const newRequest = { ...request };
|
|
3399
3415
|
if (action === "mfaSmsEnrollment" /* RecaptchaActionName.MFA_SMS_ENROLLMENT */ ||
|
|
3400
3416
|
action === "mfaSmsSignIn" /* RecaptchaActionName.MFA_SMS_SIGNIN */) {
|
|
3401
3417
|
if ('phoneEnrollmentInfo' in newRequest) {
|
|
@@ -3437,10 +3453,10 @@ async function injectRecaptchaFields(auth, request, action, isCaptchaResp = fals
|
|
|
3437
3453
|
return newRequest;
|
|
3438
3454
|
}
|
|
3439
3455
|
async function handleRecaptchaFlow(authInstance, request, actionName, actionMethod, recaptchaAuthProvider) {
|
|
3440
|
-
var _a, _b;
|
|
3441
3456
|
if (recaptchaAuthProvider === "EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */) {
|
|
3442
|
-
if (
|
|
3443
|
-
._getRecaptchaConfig()
|
|
3457
|
+
if (authInstance
|
|
3458
|
+
._getRecaptchaConfig()
|
|
3459
|
+
?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */)) {
|
|
3444
3460
|
const requestWithRecaptcha = await injectRecaptchaFields(authInstance, request, actionName, actionName === "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */);
|
|
3445
3461
|
return actionMethod(authInstance, requestWithRecaptcha);
|
|
3446
3462
|
}
|
|
@@ -3458,13 +3474,14 @@ async function handleRecaptchaFlow(authInstance, request, actionName, actionMeth
|
|
|
3458
3474
|
}
|
|
3459
3475
|
}
|
|
3460
3476
|
else if (recaptchaAuthProvider === "PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */) {
|
|
3461
|
-
if (
|
|
3462
|
-
._getRecaptchaConfig()
|
|
3477
|
+
if (authInstance
|
|
3478
|
+
._getRecaptchaConfig()
|
|
3479
|
+
?.isProviderEnabled("PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */)) {
|
|
3463
3480
|
const requestWithRecaptcha = await injectRecaptchaFields(authInstance, request, actionName);
|
|
3464
3481
|
return actionMethod(authInstance, requestWithRecaptcha).catch(async (error) => {
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3482
|
+
if (authInstance
|
|
3483
|
+
._getRecaptchaConfig()
|
|
3484
|
+
?.getProviderEnforcementState("PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */) === "AUDIT" /* EnforcementState.AUDIT */) {
|
|
3468
3485
|
// AUDIT mode
|
|
3469
3486
|
if (error.code === `auth/${"missing-recaptcha-token" /* AuthErrorCode.MISSING_RECAPTCHA_TOKEN */}` ||
|
|
3470
3487
|
error.code === `auth/${"invalid-app-credential" /* AuthErrorCode.INVALID_APP_CREDENTIAL */}`) {
|
|
@@ -3561,7 +3578,7 @@ function initializeAuth(app$1, deps) {
|
|
|
3561
3578
|
if (provider.isInitialized()) {
|
|
3562
3579
|
const auth = provider.getImmediate();
|
|
3563
3580
|
const initialOptions = provider.getOptions();
|
|
3564
|
-
if (util.deepEqual(initialOptions, deps
|
|
3581
|
+
if (util.deepEqual(initialOptions, deps ?? {})) {
|
|
3565
3582
|
return auth;
|
|
3566
3583
|
}
|
|
3567
3584
|
else {
|
|
@@ -3572,15 +3589,15 @@ function initializeAuth(app$1, deps) {
|
|
|
3572
3589
|
return auth;
|
|
3573
3590
|
}
|
|
3574
3591
|
function _initializeAuthInstance(auth, deps) {
|
|
3575
|
-
const persistence =
|
|
3592
|
+
const persistence = deps?.persistence || [];
|
|
3576
3593
|
const hierarchy = (Array.isArray(persistence) ? persistence : [persistence]).map(_getInstance);
|
|
3577
|
-
if (deps
|
|
3594
|
+
if (deps?.errorMap) {
|
|
3578
3595
|
auth._updateErrorMap(deps.errorMap);
|
|
3579
3596
|
}
|
|
3580
3597
|
// This promise is intended to float; auth initialization happens in the
|
|
3581
3598
|
// background, meanwhile the auth object may be used by the app.
|
|
3582
3599
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
3583
|
-
auth._initializeWithPersistence(hierarchy, deps
|
|
3600
|
+
auth._initializeWithPersistence(hierarchy, deps?.popupRedirectResolver);
|
|
3584
3601
|
}
|
|
3585
3602
|
|
|
3586
3603
|
/**
|
|
@@ -3608,7 +3625,7 @@ function _initializeAuthInstance(auth, deps) {
|
|
|
3608
3625
|
function connectAuthEmulator(auth, url, options) {
|
|
3609
3626
|
const authInternal = _castAuth(auth);
|
|
3610
3627
|
_assert(/^https?:\/\//.test(url), authInternal, "invalid-emulator-scheme" /* AuthErrorCode.INVALID_EMULATOR_SCHEME */);
|
|
3611
|
-
const disableWarnings = !!
|
|
3628
|
+
const disableWarnings = !!options?.disableWarnings;
|
|
3612
3629
|
const protocol = extractProtocol(url);
|
|
3613
3630
|
const { host, port } = extractHostAndPort(url);
|
|
3614
3631
|
const portStr = port === null ? '' : `:${port}`;
|
|
@@ -3934,7 +3951,7 @@ class EmailAuthCredential extends AuthCredential {
|
|
|
3934
3951
|
*/
|
|
3935
3952
|
static fromJSON(json) {
|
|
3936
3953
|
const obj = typeof json === 'string' ? JSON.parse(json) : json;
|
|
3937
|
-
if (
|
|
3954
|
+
if (obj?.email && obj?.password) {
|
|
3938
3955
|
if (obj.signInMethod === "password" /* SignInMethod.EMAIL_PASSWORD */) {
|
|
3939
3956
|
return this._fromEmailAndPassword(obj.email, obj.password);
|
|
3940
3957
|
}
|
|
@@ -4094,7 +4111,7 @@ class OAuthCredential extends AuthCredential {
|
|
|
4094
4111
|
*/
|
|
4095
4112
|
static fromJSON(json) {
|
|
4096
4113
|
const obj = typeof json === 'string' ? JSON.parse(json) : json;
|
|
4097
|
-
const { providerId, signInMethod
|
|
4114
|
+
const { providerId, signInMethod, ...rest } = obj;
|
|
4098
4115
|
if (!providerId || !signInMethod) {
|
|
4099
4116
|
return null;
|
|
4100
4117
|
}
|
|
@@ -4182,7 +4199,10 @@ const VERIFY_PHONE_NUMBER_FOR_EXISTING_ERROR_MAP_ = {
|
|
|
4182
4199
|
["USER_NOT_FOUND" /* ServerError.USER_NOT_FOUND */]: "user-not-found" /* AuthErrorCode.USER_DELETED */
|
|
4183
4200
|
};
|
|
4184
4201
|
async function verifyPhoneNumberForExisting(auth, request) {
|
|
4185
|
-
const apiRequest =
|
|
4202
|
+
const apiRequest = {
|
|
4203
|
+
...request,
|
|
4204
|
+
operation: 'REAUTH'
|
|
4205
|
+
};
|
|
4186
4206
|
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_);
|
|
4187
4207
|
}
|
|
4188
4208
|
|
|
@@ -4226,7 +4246,10 @@ class PhoneAuthCredential extends AuthCredential {
|
|
|
4226
4246
|
}
|
|
4227
4247
|
/** @internal */
|
|
4228
4248
|
_linkToIdToken(auth, idToken) {
|
|
4229
|
-
return linkWithPhoneNumber$1(auth,
|
|
4249
|
+
return linkWithPhoneNumber$1(auth, {
|
|
4250
|
+
idToken,
|
|
4251
|
+
...this._makeVerificationRequest()
|
|
4252
|
+
});
|
|
4230
4253
|
}
|
|
4231
4254
|
/** @internal */
|
|
4232
4255
|
_getReauthenticationResolver(auth) {
|
|
@@ -4354,19 +4377,18 @@ class ActionCodeURL {
|
|
|
4354
4377
|
* @internal
|
|
4355
4378
|
*/
|
|
4356
4379
|
constructor(actionLink) {
|
|
4357
|
-
var _a, _b, _c, _d, _e, _f;
|
|
4358
4380
|
const searchParams = util.querystringDecode(util.extractQuerystring(actionLink));
|
|
4359
|
-
const apiKey =
|
|
4360
|
-
const code =
|
|
4361
|
-
const operation = parseMode(
|
|
4381
|
+
const apiKey = searchParams["apiKey" /* QueryField.API_KEY */] ?? null;
|
|
4382
|
+
const code = searchParams["oobCode" /* QueryField.CODE */] ?? null;
|
|
4383
|
+
const operation = parseMode(searchParams["mode" /* QueryField.MODE */] ?? null);
|
|
4362
4384
|
// Validate API key, code and mode.
|
|
4363
4385
|
_assert(apiKey && code && operation, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
4364
4386
|
this.apiKey = apiKey;
|
|
4365
4387
|
this.operation = operation;
|
|
4366
4388
|
this.code = code;
|
|
4367
|
-
this.continueUrl =
|
|
4368
|
-
this.languageCode =
|
|
4369
|
-
this.tenantId =
|
|
4389
|
+
this.continueUrl = searchParams["continueUrl" /* QueryField.CONTINUE_URL */] ?? null;
|
|
4390
|
+
this.languageCode = searchParams["lang" /* QueryField.LANGUAGE_CODE */] ?? null;
|
|
4391
|
+
this.tenantId = searchParams["tenantId" /* QueryField.TENANT_ID */] ?? null;
|
|
4370
4392
|
}
|
|
4371
4393
|
/**
|
|
4372
4394
|
* Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,
|
|
@@ -4382,7 +4404,7 @@ class ActionCodeURL {
|
|
|
4382
4404
|
try {
|
|
4383
4405
|
return new ActionCodeURL(actionLink);
|
|
4384
4406
|
}
|
|
4385
|
-
catch
|
|
4407
|
+
catch {
|
|
4386
4408
|
return null;
|
|
4387
4409
|
}
|
|
4388
4410
|
}
|
|
@@ -4672,13 +4694,17 @@ class OAuthProvider extends BaseOAuthProvider {
|
|
|
4672
4694
|
* or the ID token string.
|
|
4673
4695
|
*/
|
|
4674
4696
|
credential(params) {
|
|
4675
|
-
return this._credential(
|
|
4697
|
+
return this._credential({ ...params, nonce: params.rawNonce });
|
|
4676
4698
|
}
|
|
4677
4699
|
/** An internal credential method that accepts more permissive options */
|
|
4678
4700
|
_credential(params) {
|
|
4679
4701
|
_assert(params.idToken || params.accessToken, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
4680
4702
|
// For OAuthCredential, sign in method is same as providerId.
|
|
4681
|
-
return OAuthCredential._fromParams(
|
|
4703
|
+
return OAuthCredential._fromParams({
|
|
4704
|
+
...params,
|
|
4705
|
+
providerId: this.providerId,
|
|
4706
|
+
signInMethod: this.providerId
|
|
4707
|
+
});
|
|
4682
4708
|
}
|
|
4683
4709
|
/**
|
|
4684
4710
|
* Used to extract the underlying {@link OAuthCredential} from a {@link UserCredential}.
|
|
@@ -4830,7 +4856,7 @@ class FacebookAuthProvider extends BaseOAuthProvider {
|
|
|
4830
4856
|
try {
|
|
4831
4857
|
return FacebookAuthProvider.credential(tokenResponse.oauthAccessToken);
|
|
4832
4858
|
}
|
|
4833
|
-
catch
|
|
4859
|
+
catch {
|
|
4834
4860
|
return null;
|
|
4835
4861
|
}
|
|
4836
4862
|
}
|
|
@@ -4952,7 +4978,7 @@ class GoogleAuthProvider extends BaseOAuthProvider {
|
|
|
4952
4978
|
try {
|
|
4953
4979
|
return GoogleAuthProvider.credential(oauthIdToken, oauthAccessToken);
|
|
4954
4980
|
}
|
|
4955
|
-
catch
|
|
4981
|
+
catch {
|
|
4956
4982
|
return null;
|
|
4957
4983
|
}
|
|
4958
4984
|
}
|
|
@@ -5063,7 +5089,7 @@ class GithubAuthProvider extends BaseOAuthProvider {
|
|
|
5063
5089
|
try {
|
|
5064
5090
|
return GithubAuthProvider.credential(tokenResponse.oauthAccessToken);
|
|
5065
5091
|
}
|
|
5066
|
-
catch
|
|
5092
|
+
catch {
|
|
5067
5093
|
return null;
|
|
5068
5094
|
}
|
|
5069
5095
|
}
|
|
@@ -5347,7 +5373,7 @@ class TwitterAuthProvider extends BaseOAuthProvider {
|
|
|
5347
5373
|
try {
|
|
5348
5374
|
return TwitterAuthProvider.credential(oauthAccessToken, oauthTokenSecret);
|
|
5349
5375
|
}
|
|
5350
|
-
catch
|
|
5376
|
+
catch {
|
|
5351
5377
|
return null;
|
|
5352
5378
|
}
|
|
5353
5379
|
}
|
|
@@ -5463,13 +5489,12 @@ function providerIdForResponse(response) {
|
|
|
5463
5489
|
* @public
|
|
5464
5490
|
*/
|
|
5465
5491
|
async function signInAnonymously(auth) {
|
|
5466
|
-
var _a;
|
|
5467
5492
|
if (app._isFirebaseServerApp(auth.app)) {
|
|
5468
5493
|
return Promise.reject(_serverAppCurrentUserOperationNotSupportedError(auth));
|
|
5469
5494
|
}
|
|
5470
5495
|
const authInternal = _castAuth(auth);
|
|
5471
5496
|
await authInternal._initializationPromise;
|
|
5472
|
-
if (
|
|
5497
|
+
if (authInternal.currentUser?.isAnonymous) {
|
|
5473
5498
|
// If an anonymous user is already signed in, no need to sign them in again.
|
|
5474
5499
|
return new UserCredentialImpl({
|
|
5475
5500
|
user: authInternal.currentUser,
|
|
@@ -5503,7 +5528,6 @@ async function signInAnonymously(auth) {
|
|
|
5503
5528
|
*/
|
|
5504
5529
|
class MultiFactorError extends util.FirebaseError {
|
|
5505
5530
|
constructor(auth, error, operationType, user) {
|
|
5506
|
-
var _a;
|
|
5507
5531
|
super(error.code, error.message);
|
|
5508
5532
|
this.operationType = operationType;
|
|
5509
5533
|
this.user = user;
|
|
@@ -5511,7 +5535,7 @@ class MultiFactorError extends util.FirebaseError {
|
|
|
5511
5535
|
Object.setPrototypeOf(this, MultiFactorError.prototype);
|
|
5512
5536
|
this.customData = {
|
|
5513
5537
|
appName: auth.name,
|
|
5514
|
-
tenantId:
|
|
5538
|
+
tenantId: auth.tenantId ?? undefined,
|
|
5515
5539
|
_serverResponse: error.customData._serverResponse,
|
|
5516
5540
|
operationType
|
|
5517
5541
|
};
|
|
@@ -5642,7 +5666,7 @@ async function _reauthenticate(user, credential, bypassAuthState = false) {
|
|
|
5642
5666
|
}
|
|
5643
5667
|
catch (e) {
|
|
5644
5668
|
// Convert user deleted error into user mismatch
|
|
5645
|
-
if (
|
|
5669
|
+
if (e?.code === `auth/${"user-not-found" /* AuthErrorCode.USER_DELETED */}`) {
|
|
5646
5670
|
_fail(auth, "user-mismatch" /* AuthErrorCode.USER_MISMATCH */);
|
|
5647
5671
|
}
|
|
5648
5672
|
throw e;
|
|
@@ -5867,8 +5891,7 @@ class TotpMultiFactorInfoImpl extends MultiFactorInfoImpl {
|
|
|
5867
5891
|
* limitations under the License.
|
|
5868
5892
|
*/
|
|
5869
5893
|
function _setActionCodeSettingsOnRequest(auth, request, actionCodeSettings) {
|
|
5870
|
-
|
|
5871
|
-
_assert(((_a = actionCodeSettings.url) === null || _a === void 0 ? void 0 : _a.length) > 0, auth, "invalid-continue-uri" /* AuthErrorCode.INVALID_CONTINUE_URI */);
|
|
5894
|
+
_assert(actionCodeSettings.url?.length > 0, auth, "invalid-continue-uri" /* AuthErrorCode.INVALID_CONTINUE_URI */);
|
|
5872
5895
|
_assert(typeof actionCodeSettings.dynamicLinkDomain === 'undefined' ||
|
|
5873
5896
|
actionCodeSettings.dynamicLinkDomain.length > 0, auth, "invalid-dynamic-link-domain" /* AuthErrorCode.INVALID_DYNAMIC_LINK_DOMAIN */);
|
|
5874
5897
|
_assert(typeof actionCodeSettings.linkDomain === 'undefined' ||
|
|
@@ -6229,7 +6252,7 @@ async function sendSignInLinkToEmail(auth, email, actionCodeSettings) {
|
|
|
6229
6252
|
*/
|
|
6230
6253
|
function isSignInWithEmailLink(auth, emailLink) {
|
|
6231
6254
|
const actionCodeUrl = ActionCodeURL.parseLink(emailLink);
|
|
6232
|
-
return
|
|
6255
|
+
return actionCodeUrl?.operation === "EMAIL_SIGNIN" /* ActionCodeOperation.EMAIL_SIGNIN */;
|
|
6233
6256
|
}
|
|
6234
6257
|
/**
|
|
6235
6258
|
* Asynchronously signs in using an email and sign-in email link.
|
|
@@ -6602,7 +6625,6 @@ async function updateEmailOrPassword(user, email, password) {
|
|
|
6602
6625
|
*
|
|
6603
6626
|
*/
|
|
6604
6627
|
function _fromIdTokenResponse(idTokenResponse) {
|
|
6605
|
-
var _a, _b;
|
|
6606
6628
|
if (!idTokenResponse) {
|
|
6607
6629
|
return null;
|
|
6608
6630
|
}
|
|
@@ -6612,8 +6634,8 @@ function _fromIdTokenResponse(idTokenResponse) {
|
|
|
6612
6634
|
: {};
|
|
6613
6635
|
const isNewUser = idTokenResponse.isNewUser ||
|
|
6614
6636
|
idTokenResponse.kind === "identitytoolkit#SignupNewUserResponse" /* IdTokenResponseKind.SignupNewUser */;
|
|
6615
|
-
if (!providerId &&
|
|
6616
|
-
const signInProvider =
|
|
6637
|
+
if (!providerId && idTokenResponse?.idToken) {
|
|
6638
|
+
const signInProvider = _parseToken(idTokenResponse.idToken)?.firebase?.['sign_in_provider'];
|
|
6617
6639
|
if (signInProvider) {
|
|
6618
6640
|
const filteredProviderId = signInProvider !== "anonymous" /* ProviderId.ANONYMOUS */ &&
|
|
6619
6641
|
signInProvider !== "custom" /* ProviderId.CUSTOM */
|
|
@@ -6662,7 +6684,7 @@ class FacebookAdditionalUserInfo extends GenericAdditionalUserInfo {
|
|
|
6662
6684
|
}
|
|
6663
6685
|
class GithubAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername {
|
|
6664
6686
|
constructor(isNewUser, profile) {
|
|
6665
|
-
super(isNewUser, "github.com" /* ProviderId.GITHUB */, profile, typeof
|
|
6687
|
+
super(isNewUser, "github.com" /* ProviderId.GITHUB */, profile, typeof profile?.login === 'string' ? profile?.login : null);
|
|
6666
6688
|
}
|
|
6667
6689
|
}
|
|
6668
6690
|
class GoogleAdditionalUserInfo extends GenericAdditionalUserInfo {
|
|
@@ -6962,12 +6984,11 @@ class MultiFactorSessionImpl {
|
|
|
6962
6984
|
};
|
|
6963
6985
|
}
|
|
6964
6986
|
static fromJSON(obj) {
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
if ((_a = obj.multiFactorSession) === null || _a === void 0 ? void 0 : _a.pendingCredential) {
|
|
6987
|
+
if (obj?.multiFactorSession) {
|
|
6988
|
+
if (obj.multiFactorSession?.pendingCredential) {
|
|
6968
6989
|
return MultiFactorSessionImpl._fromMfaPendingCredential(obj.multiFactorSession.pendingCredential);
|
|
6969
6990
|
}
|
|
6970
|
-
else if (
|
|
6991
|
+
else if (obj.multiFactorSession?.idToken) {
|
|
6971
6992
|
return MultiFactorSessionImpl._fromIdtoken(obj.multiFactorSession.idToken);
|
|
6972
6993
|
}
|
|
6973
6994
|
}
|
|
@@ -7010,7 +7031,11 @@ class MultiFactorResolverImpl {
|
|
|
7010
7031
|
delete serverResponse.mfaInfo;
|
|
7011
7032
|
delete serverResponse.mfaPendingCredential;
|
|
7012
7033
|
// Use in the new token & refresh token in the old response
|
|
7013
|
-
const idTokenResponse =
|
|
7034
|
+
const idTokenResponse = {
|
|
7035
|
+
...serverResponse,
|
|
7036
|
+
idToken: mfaResponse.idToken,
|
|
7037
|
+
refreshToken: mfaResponse.refreshToken
|
|
7038
|
+
};
|
|
7014
7039
|
// TODO: we should collapse this switch statement into UserCredentialImpl._forOperation and have it support the SIGN_IN case
|
|
7015
7040
|
switch (error.operationType) {
|
|
7016
7041
|
case "signIn" /* OperationType.SIGN_IN */:
|
|
@@ -7041,11 +7066,10 @@ class MultiFactorResolverImpl {
|
|
|
7041
7066
|
* @public
|
|
7042
7067
|
*/
|
|
7043
7068
|
function getMultiFactorResolver(auth, error) {
|
|
7044
|
-
var _a;
|
|
7045
7069
|
const authModular = util.getModularInstance(auth);
|
|
7046
7070
|
const errorInternal = error;
|
|
7047
7071
|
_assert(error.customData.operationType, authModular, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
7048
|
-
_assert(
|
|
7072
|
+
_assert(errorInternal.customData._serverResponse?.mfaPendingCredential, authModular, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
7049
7073
|
return MultiFactorResolverImpl._fromError(authModular, errorInternal);
|
|
7050
7074
|
}
|
|
7051
7075
|
|
|
@@ -7145,7 +7169,7 @@ function multiFactor(user) {
|
|
|
7145
7169
|
}
|
|
7146
7170
|
|
|
7147
7171
|
var name = "@firebase/auth";
|
|
7148
|
-
var version = "1.10.
|
|
7172
|
+
var version = "1.10.8-canary.25b60fdaa";
|
|
7149
7173
|
|
|
7150
7174
|
/**
|
|
7151
7175
|
* @license
|
|
@@ -7169,9 +7193,8 @@ class AuthInterop {
|
|
|
7169
7193
|
this.internalListeners = new Map();
|
|
7170
7194
|
}
|
|
7171
7195
|
getUid() {
|
|
7172
|
-
var _a;
|
|
7173
7196
|
this.assertAuthConfigured();
|
|
7174
|
-
return
|
|
7197
|
+
return this.auth.currentUser?.uid || null;
|
|
7175
7198
|
}
|
|
7176
7199
|
async getToken(forceRefresh) {
|
|
7177
7200
|
this.assertAuthConfigured();
|
|
@@ -7188,7 +7211,7 @@ class AuthInterop {
|
|
|
7188
7211
|
return;
|
|
7189
7212
|
}
|
|
7190
7213
|
const unsubscribe = this.auth.onIdTokenChanged(user => {
|
|
7191
|
-
listener(
|
|
7214
|
+
listener(user?.stsTokenManager.accessToken || null);
|
|
7192
7215
|
});
|
|
7193
7216
|
this.internalListeners.set(listener, unsubscribe);
|
|
7194
7217
|
this.updateProactiveRefresh();
|
|
@@ -7287,8 +7310,8 @@ function registerAuth(clientPlatform) {
|
|
|
7287
7310
|
return (auth => new AuthInterop(auth))(auth);
|
|
7288
7311
|
}, "PRIVATE" /* ComponentType.PRIVATE */).setInstantiationMode("EXPLICIT" /* InstantiationMode.EXPLICIT */));
|
|
7289
7312
|
app.registerVersion(name, version, getVersionForPlatform(clientPlatform));
|
|
7290
|
-
// BUILD_TARGET will be replaced by values like
|
|
7291
|
-
app.registerVersion(name, version, '
|
|
7313
|
+
// BUILD_TARGET will be replaced by values like esm, cjs, etc during the compilation
|
|
7314
|
+
app.registerVersion(name, version, 'cjs2020');
|
|
7292
7315
|
}
|
|
7293
7316
|
|
|
7294
7317
|
/**
|
|
@@ -7450,9 +7473,8 @@ class TotpMultiFactorGenerator {
|
|
|
7450
7473
|
* @returns A promise to {@link TotpSecret}.
|
|
7451
7474
|
*/
|
|
7452
7475
|
static async generateSecret(session) {
|
|
7453
|
-
var _a;
|
|
7454
7476
|
const mfaSession = session;
|
|
7455
|
-
_assert(typeof
|
|
7477
|
+
_assert(typeof mfaSession.user?.auth !== 'undefined', "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
7456
7478
|
const response = await startEnrollTotpMfa(mfaSession.user.auth, {
|
|
7457
7479
|
idToken: mfaSession.credential,
|
|
7458
7480
|
totpEnrollmentInfo: {}
|
|
@@ -7536,14 +7558,13 @@ class TotpSecret {
|
|
|
7536
7558
|
* @returns A QR code URL string.
|
|
7537
7559
|
*/
|
|
7538
7560
|
generateQrCodeUrl(accountName, issuer) {
|
|
7539
|
-
var _a;
|
|
7540
7561
|
let useDefaults = false;
|
|
7541
7562
|
if (_isEmptyString(accountName) || _isEmptyString(issuer)) {
|
|
7542
7563
|
useDefaults = true;
|
|
7543
7564
|
}
|
|
7544
7565
|
if (useDefaults) {
|
|
7545
7566
|
if (_isEmptyString(accountName)) {
|
|
7546
|
-
accountName =
|
|
7567
|
+
accountName = this.auth.currentUser?.email || 'unknownuser';
|
|
7547
7568
|
}
|
|
7548
7569
|
if (_isEmptyString(issuer)) {
|
|
7549
7570
|
issuer = this.auth.name;
|
|
@@ -7554,7 +7575,7 @@ class TotpSecret {
|
|
|
7554
7575
|
}
|
|
7555
7576
|
/** @internal */
|
|
7556
7577
|
function _isEmptyString(input) {
|
|
7557
|
-
return typeof input === 'undefined' ||
|
|
7578
|
+
return typeof input === 'undefined' || input?.length === 0;
|
|
7558
7579
|
}
|
|
7559
7580
|
|
|
7560
7581
|
exports.AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY = AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY;
|
|
@@ -7668,4 +7689,4 @@ exports.useDeviceLanguage = useDeviceLanguage;
|
|
|
7668
7689
|
exports.validatePassword = validatePassword;
|
|
7669
7690
|
exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
|
|
7670
7691
|
exports.verifyPasswordResetCode = verifyPasswordResetCode;
|
|
7671
|
-
//# sourceMappingURL=totp-
|
|
7692
|
+
//# sourceMappingURL=totp-e66b7ec4.js.map
|