@firebase/auth 0.18.3-canary.f0f6d74b5 → 0.18.3-pr5646.1ea90dcb0
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/auth-public.d.ts +3 -0
- package/dist/auth.d.ts +3 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/index.rn.d.ts +3 -0
- package/dist/cordova/internal.js +5 -2
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-d7c73820.js → popup_redirect-2dca2cb1.js} +2 -2
- package/dist/cordova/{popup_redirect-d7c73820.js.map → popup_redirect-2dca2cb1.js.map} +1 -1
- package/dist/cordova/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/esm2017/{index-c05124f9.js → index-ba6b78f9.js} +5 -2
- package/dist/esm2017/{index-c05124f9.js.map → index-ba6b78f9.js.map} +1 -1
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/index.rn.d.ts +3 -0
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/esm5/{index-095e7b8b.js → index-40ef730a.js} +5 -2
- package/dist/esm5/{index-095e7b8b.js.map → index-40ef730a.js.map} +1 -1
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/index.rn.d.ts +3 -0
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/index.rn.d.ts +3 -0
- package/dist/index.webworker.esm5.js +1 -1
- package/dist/node/{index-5164904c.js → index-118ac8cf.js} +2 -2
- package/dist/node/{index-5164904c.js.map → index-118ac8cf.js.map} +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.rn.d.ts +3 -0
- package/dist/node/internal.js +1 -1
- package/dist/node/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/node-esm/index-a0f7942c.js +6030 -0
- package/dist/node-esm/index-a0f7942c.js.map +1 -0
- package/dist/node-esm/index.cordova.d.ts +32 -0
- package/dist/node-esm/index.d.ts +36 -0
- package/dist/node-esm/index.doc.d.ts +24 -0
- package/dist/node-esm/index.js +8 -0
- package/dist/node-esm/index.js.map +1 -0
- package/dist/node-esm/index.node.d.ts +17 -0
- package/dist/node-esm/index.rn.d.ts +30 -0
- package/dist/node-esm/index.shared.d.ts +19 -0
- package/dist/node-esm/index.webworker.d.ts +21 -0
- package/dist/node-esm/internal/index.d.ts +41 -0
- package/dist/node-esm/internal.js +1455 -0
- package/dist/node-esm/internal.js.map +1 -0
- package/dist/node-esm/package.json +1 -0
- package/dist/node-esm/scripts/run_node_tests.d.ts +17 -0
- package/dist/node-esm/src/api/account_management/account.d.ts +59 -0
- package/dist/node-esm/src/api/account_management/account.test.d.ts +17 -0
- package/dist/node-esm/src/api/account_management/email_and_password.d.ts +47 -0
- package/dist/node-esm/src/api/account_management/email_and_password.test.d.ts +17 -0
- package/dist/node-esm/src/api/account_management/mfa.d.ts +69 -0
- package/dist/node-esm/src/api/account_management/mfa.test.d.ts +17 -0
- package/dist/node-esm/src/api/account_management/profile.d.ts +29 -0
- package/dist/node-esm/src/api/account_management/profile.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/create_auth_uri.d.ts +26 -0
- package/dist/node-esm/src/api/authentication/create_auth_uri.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/custom_token.d.ts +26 -0
- package/dist/node-esm/src/api/authentication/custom_token.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/email_and_password.d.ts +76 -0
- package/dist/node-esm/src/api/authentication/email_and_password.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/email_link.d.ts +32 -0
- package/dist/node-esm/src/api/authentication/email_link.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/idp.d.ts +40 -0
- package/dist/node-esm/src/api/authentication/idp.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/mfa.d.ts +58 -0
- package/dist/node-esm/src/api/authentication/mfa.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/recaptcha.d.ts +18 -0
- package/dist/node-esm/src/api/authentication/recaptcha.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/sign_up.d.ts +29 -0
- package/dist/node-esm/src/api/authentication/sign_up.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/sms.d.ts +50 -0
- package/dist/node-esm/src/api/authentication/sms.test.d.ts +17 -0
- package/dist/node-esm/src/api/authentication/token.d.ts +26 -0
- package/dist/node-esm/src/api/authentication/token.test.d.ts +17 -0
- package/dist/node-esm/src/api/errors.d.ts +118 -0
- package/dist/node-esm/src/api/index.d.ts +67 -0
- package/dist/node-esm/src/api/index.test.d.ts +17 -0
- package/dist/node-esm/src/api/project_config/get_project_config.d.ts +25 -0
- package/dist/node-esm/src/api/project_config/get_project_config.test.d.ts +17 -0
- package/dist/node-esm/src/core/action_code_url.d.ts +73 -0
- package/dist/node-esm/src/core/action_code_url.test.d.ts +17 -0
- package/dist/node-esm/src/core/auth/auth_event_manager.d.ts +34 -0
- package/dist/node-esm/src/core/auth/auth_event_manager.test.d.ts +17 -0
- package/dist/node-esm/src/core/auth/auth_impl.d.ts +106 -0
- package/dist/node-esm/src/core/auth/auth_impl.test.d.ts +17 -0
- package/dist/node-esm/src/core/auth/emulator.d.ts +42 -0
- package/dist/node-esm/src/core/auth/emulator.test.d.ts +17 -0
- package/dist/node-esm/src/core/auth/firebase_internal.d.ts +35 -0
- package/dist/node-esm/src/core/auth/firebase_internal.test.d.ts +17 -0
- package/dist/node-esm/src/core/auth/initialize.d.ts +46 -0
- package/dist/node-esm/src/core/auth/initialize.test.d.ts +17 -0
- package/dist/node-esm/src/core/auth/register.d.ts +23 -0
- package/dist/node-esm/src/core/credentials/auth_credential.d.ts +75 -0
- package/dist/node-esm/src/core/credentials/email.d.ts +60 -0
- package/dist/node-esm/src/core/credentials/email.test.d.ts +17 -0
- package/dist/node-esm/src/core/credentials/index.d.ts +23 -0
- package/dist/node-esm/src/core/credentials/oauth.d.ts +81 -0
- package/dist/node-esm/src/core/credentials/oauth.test.d.ts +17 -0
- package/dist/node-esm/src/core/credentials/phone.d.ts +52 -0
- package/dist/node-esm/src/core/credentials/phone.test.d.ts +17 -0
- package/dist/node-esm/src/core/credentials/saml.d.ts +52 -0
- package/dist/node-esm/src/core/credentials/saml.test.d.ts +17 -0
- package/dist/node-esm/src/core/errors.d.ts +299 -0
- package/dist/node-esm/src/core/errors.test.d.ts +17 -0
- package/dist/node-esm/src/core/index.d.ts +141 -0
- package/dist/node-esm/src/core/persistence/in_memory.d.ts +35 -0
- package/dist/node-esm/src/core/persistence/in_memory.test.d.ts +17 -0
- package/dist/node-esm/src/core/persistence/index.d.ts +41 -0
- package/dist/node-esm/src/core/persistence/persistence_user_manager.d.ts +45 -0
- package/dist/node-esm/src/core/persistence/persistence_user_manager.test.d.ts +17 -0
- package/dist/node-esm/src/core/providers/email.d.ts +83 -0
- package/dist/node-esm/src/core/providers/email.test.d.ts +17 -0
- package/dist/node-esm/src/core/providers/facebook.d.ts +93 -0
- package/dist/node-esm/src/core/providers/facebook.test.d.ts +17 -0
- package/dist/node-esm/src/core/providers/federated.d.ts +64 -0
- package/dist/node-esm/src/core/providers/federated.test.d.ts +17 -0
- package/dist/node-esm/src/core/providers/github.d.ts +89 -0
- package/dist/node-esm/src/core/providers/github.test.d.ts +17 -0
- package/dist/node-esm/src/core/providers/google.d.ts +96 -0
- package/dist/node-esm/src/core/providers/google.test.d.ts +17 -0
- package/dist/node-esm/src/core/providers/oauth.d.ts +151 -0
- package/dist/node-esm/src/core/providers/oauth.test.d.ts +17 -0
- package/dist/node-esm/src/core/providers/saml.d.ts +62 -0
- package/dist/node-esm/src/core/providers/saml.test.d.ts +17 -0
- package/dist/node-esm/src/core/providers/twitter.d.ts +103 -0
- package/dist/node-esm/src/core/providers/twitter.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/abstract_popup_redirect_operation.d.ts +44 -0
- package/dist/node-esm/src/core/strategies/abstract_popup_redirect_operation.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/action_code_settings.d.ts +19 -0
- package/dist/node-esm/src/core/strategies/action_code_settings.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/anonymous.d.ts +29 -0
- package/dist/node-esm/src/core/strategies/anonymous.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/credential.d.ts +57 -0
- package/dist/node-esm/src/core/strategies/credential.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/custom_token.d.ts +34 -0
- package/dist/node-esm/src/core/strategies/custom_token.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/email.d.ts +98 -0
- package/dist/node-esm/src/core/strategies/email.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/email_and_password.d.ts +126 -0
- package/dist/node-esm/src/core/strategies/email_and_password.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/email_link.d.ts +103 -0
- package/dist/node-esm/src/core/strategies/email_link.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/idp.d.ts +32 -0
- package/dist/node-esm/src/core/strategies/idp.test.d.ts +17 -0
- package/dist/node-esm/src/core/strategies/redirect.d.ts +35 -0
- package/dist/node-esm/src/core/strategies/redirect.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/account_info.d.ts +60 -0
- package/dist/node-esm/src/core/user/account_info.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/additional_user_info.d.ts +31 -0
- package/dist/node-esm/src/core/user/additional_user_info.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/id_token_result.d.ts +48 -0
- package/dist/node-esm/src/core/user/id_token_result.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/invalidation.d.ts +18 -0
- package/dist/node-esm/src/core/user/invalidation.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/link_unlink.d.ts +30 -0
- package/dist/node-esm/src/core/user/link_unlink.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/proactive_refresh.d.ts +34 -0
- package/dist/node-esm/src/core/user/proactive_refresh.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/reauthenticate.d.ts +20 -0
- package/dist/node-esm/src/core/user/reauthenticate.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/reload.d.ts +27 -0
- package/dist/node-esm/src/core/user/reload.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/token_manager.d.ts +49 -0
- package/dist/node-esm/src/core/user/token_manager.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/user_credential_impl.d.ts +37 -0
- package/dist/node-esm/src/core/user/user_credential_impl.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/user_impl.d.ts +68 -0
- package/dist/node-esm/src/core/user/user_impl.test.d.ts +17 -0
- package/dist/node-esm/src/core/user/user_metadata.d.ts +27 -0
- package/dist/node-esm/src/core/util/assert.d.ts +93 -0
- package/dist/node-esm/src/core/util/assert.test.d.ts +17 -0
- package/dist/node-esm/src/core/util/browser.d.ts +50 -0
- package/dist/node-esm/src/core/util/browser.test.d.ts +17 -0
- package/dist/node-esm/src/core/util/delay.d.ts +31 -0
- package/dist/node-esm/src/core/util/delay.test.d.ts +17 -0
- package/dist/node-esm/src/core/util/emulator.d.ts +18 -0
- package/dist/node-esm/src/core/util/emulator.test.d.ts +17 -0
- package/dist/node-esm/src/core/util/event_id.d.ts +17 -0
- package/dist/node-esm/src/core/util/event_id.test.d.ts +17 -0
- package/dist/node-esm/src/core/util/fetch_provider.d.ts +25 -0
- package/dist/node-esm/src/core/util/handler.d.ts +20 -0
- package/dist/node-esm/src/core/util/instantiator.d.ts +28 -0
- package/dist/node-esm/src/core/util/instantiator.test.d.ts +17 -0
- package/dist/node-esm/src/core/util/location.d.ts +19 -0
- package/dist/node-esm/src/core/util/log.d.ts +22 -0
- package/dist/node-esm/src/core/util/navigator.d.ts +21 -0
- package/dist/node-esm/src/core/util/providers.d.ts +23 -0
- package/dist/node-esm/src/core/util/resolver.d.ts +25 -0
- package/dist/node-esm/src/core/util/time.d.ts +17 -0
- package/dist/node-esm/src/core/util/validate_origin.d.ts +18 -0
- package/dist/node-esm/src/core/util/validate_origin.test.d.ts +17 -0
- package/dist/node-esm/src/core/util/version.d.ts +30 -0
- package/dist/node-esm/src/core/util/version.test.d.ts +17 -0
- package/dist/node-esm/src/index.d.ts +18 -0
- package/dist/node-esm/src/mfa/index.d.ts +18 -0
- package/dist/node-esm/src/mfa/mfa_assertion.d.ts +27 -0
- package/dist/node-esm/src/mfa/mfa_error.d.ts +35 -0
- package/dist/node-esm/src/mfa/mfa_info.d.ts +32 -0
- package/dist/node-esm/src/mfa/mfa_info.test.d.ts +17 -0
- package/dist/node-esm/src/mfa/mfa_resolver.d.ts +41 -0
- package/dist/node-esm/src/mfa/mfa_resolver.test.d.ts +17 -0
- package/dist/node-esm/src/mfa/mfa_session.d.ts +37 -0
- package/dist/node-esm/src/mfa/mfa_session.test.d.ts +17 -0
- package/dist/node-esm/src/mfa/mfa_user.d.ts +38 -0
- package/dist/node-esm/src/mfa/mfa_user.test.d.ts +17 -0
- package/dist/node-esm/src/model/application_verifier.d.ts +23 -0
- package/dist/node-esm/src/model/auth.d.ts +75 -0
- package/dist/node-esm/src/model/enum_maps.d.ts +97 -0
- package/dist/node-esm/src/model/enums.d.ts +74 -0
- package/dist/node-esm/src/model/id_token.d.ts +84 -0
- package/dist/node-esm/src/model/popup_redirect.d.ts +92 -0
- package/dist/node-esm/src/model/public_types.d.ts +1139 -0
- package/dist/node-esm/src/model/user.d.ts +79 -0
- package/dist/node-esm/src/platform_browser/auth.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/auth_window.d.ts +37 -0
- package/dist/node-esm/src/platform_browser/iframe/gapi.d.ts +19 -0
- package/dist/node-esm/src/platform_browser/iframe/gapi.iframes.d.ts +47 -0
- package/dist/node-esm/src/platform_browser/iframe/gapi.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/iframe/iframe.d.ts +18 -0
- package/dist/node-esm/src/platform_browser/iframe/iframe.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/index.d.ts +27 -0
- package/dist/node-esm/src/platform_browser/load_js.d.ts +18 -0
- package/dist/node-esm/src/platform_browser/load_js.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/messagechannel/index.d.ts +87 -0
- package/dist/node-esm/src/platform_browser/messagechannel/promise.d.ts +33 -0
- package/dist/node-esm/src/platform_browser/messagechannel/promise.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/messagechannel/receiver.d.ts +63 -0
- package/dist/node-esm/src/platform_browser/messagechannel/receiver.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/messagechannel/sender.d.ts +46 -0
- package/dist/node-esm/src/platform_browser/messagechannel/sender.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/mfa/assertions/phone.d.ts +56 -0
- package/dist/node-esm/src/platform_browser/mfa/assertions/phone.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/persistence/browser.d.ts +27 -0
- package/dist/node-esm/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/persistence/indexed_db.d.ts +33 -0
- package/dist/node-esm/src/platform_browser/persistence/indexed_db.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/persistence/local_storage.d.ts +25 -0
- package/dist/node-esm/src/platform_browser/persistence/local_storage.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/persistence/session_storage.d.ts +24 -0
- package/dist/node-esm/src/platform_browser/persistence/session_storage.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/popup_redirect.d.ts +24 -0
- package/dist/node-esm/src/platform_browser/popup_redirect.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/providers/phone.d.ts +149 -0
- package/dist/node-esm/src/platform_browser/providers/phone.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha.d.ts +23 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_loader.d.ts +44 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_loader.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_mock.d.ts +51 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_mock.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_verifier.d.ts +94 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_verifier.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/strategies/phone.d.ts +98 -0
- package/dist/node-esm/src/platform_browser/strategies/phone.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/strategies/popup.d.ts +103 -0
- package/dist/node-esm/src/platform_browser/strategies/popup.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/strategies/redirect.d.ts +156 -0
- package/dist/node-esm/src/platform_browser/strategies/redirect.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/util/popup.d.ts +24 -0
- package/dist/node-esm/src/platform_browser/util/popup.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/util/worker.d.ts +20 -0
- package/dist/node-esm/src/platform_cordova/plugins.d.ts +42 -0
- package/dist/node-esm/src/platform_cordova/popup_redirect/events.d.ts +39 -0
- package/dist/node-esm/src/platform_cordova/popup_redirect/events.test.d.ts +17 -0
- package/dist/node-esm/src/platform_cordova/popup_redirect/popup_redirect.d.ts +24 -0
- package/dist/node-esm/src/platform_cordova/popup_redirect/popup_redirect.test.d.ts +17 -0
- package/dist/node-esm/src/platform_cordova/popup_redirect/utils.d.ts +47 -0
- package/dist/node-esm/src/platform_cordova/popup_redirect/utils.test.d.ts +17 -0
- package/dist/node-esm/src/platform_cordova/strategies/redirect.d.ts +20 -0
- package/dist/node-esm/src/platform_node/index.d.ts +49 -0
- package/dist/node-esm/src/platform_react_native/persistence/react_native.d.ts +31 -0
- package/dist/node-esm/src/platform_react_native/persistence/react_native.test.d.ts +17 -0
- package/dist/node-esm/test/helpers/api/helper.d.ts +20 -0
- package/dist/node-esm/test/helpers/delay.d.ts +20 -0
- package/dist/node-esm/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/node-esm/test/helpers/fake_service_worker.d.ts +22 -0
- package/dist/node-esm/test/helpers/id_token_response.d.ts +18 -0
- package/dist/node-esm/test/helpers/iframe_event.d.ts +19 -0
- package/dist/node-esm/test/helpers/integration/emulator_rest_helpers.d.ts +35 -0
- package/dist/node-esm/test/helpers/integration/helpers.d.ts +20 -0
- package/dist/node-esm/test/helpers/integration/settings.d.ts +23 -0
- package/dist/node-esm/test/helpers/jwt.d.ts +17 -0
- package/dist/node-esm/test/helpers/mock_auth.d.ts +37 -0
- package/dist/node-esm/test/helpers/mock_auth_credential.d.ts +31 -0
- package/dist/node-esm/test/helpers/mock_fetch.d.ts +30 -0
- package/dist/node-esm/test/helpers/mock_fetch.test.d.ts +17 -0
- package/dist/node-esm/test/helpers/mock_popup_redirect_resolver.d.ts +24 -0
- package/dist/node-esm/test/helpers/redirect_persistence.d.ts +24 -0
- package/dist/node-esm/test/helpers/timeout_stub.d.ts +34 -0
- package/dist/node-esm/test/integration/flows/anonymous.test.d.ts +17 -0
- package/dist/node-esm/test/integration/flows/custom.local.test.d.ts +17 -0
- package/dist/node-esm/test/integration/flows/email.test.d.ts +17 -0
- package/dist/node-esm/test/integration/flows/idp.local.test.d.ts +17 -0
- package/dist/node-esm/test/integration/flows/oob.local.test.d.ts +17 -0
- package/dist/node-esm/test/integration/flows/phone.test.d.ts +17 -0
- package/dist/node-esm/test/integration/webdriver/anonymous.test.d.ts +17 -0
- package/dist/node-esm/test/integration/webdriver/compat/firebaseui.test.d.ts +17 -0
- package/dist/node-esm/test/integration/webdriver/persistence.test.d.ts +17 -0
- package/dist/node-esm/test/integration/webdriver/popup.test.d.ts +17 -0
- package/dist/node-esm/test/integration/webdriver/redirect.test.d.ts +17 -0
- package/dist/node-esm/test/integration/webdriver/util/auth_driver.d.ts +46 -0
- package/dist/node-esm/test/integration/webdriver/util/functions.d.ts +77 -0
- package/dist/node-esm/test/integration/webdriver/util/idp_page.d.ts +31 -0
- package/dist/node-esm/test/integration/webdriver/util/js_load_condition.d.ts +25 -0
- package/dist/node-esm/test/integration/webdriver/util/test_runner.d.ts +19 -0
- package/dist/node-esm/test/integration/webdriver/util/test_server.d.ts +27 -0
- package/dist/node-esm/test/integration/webdriver/util/ui_page.d.ts +33 -0
- package/dist/rn/index.js +70 -64
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/index.rn.d.ts +3 -0
- package/dist/rn/internal.js +314 -1461
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{enum_maps-af013a12.js → phone-8f538dbe.js} +1171 -12
- package/dist/rn/phone-8f538dbe.js.map +1 -0
- package/dist/rn/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/src/platform_browser/strategies/phone.d.ts +3 -0
- package/package.json +31 -9
- package/dist/rn/enum_maps-af013a12.js.map +0 -1
package/dist/rn/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var phone = require('./phone-8f538dbe.js');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var util = require('@firebase/util');
|
|
8
8
|
var app = require('@firebase/app');
|
|
@@ -38,8 +38,8 @@ var BrowserPersistenceClass = /** @class */ (function () {
|
|
|
38
38
|
if (!this.storage) {
|
|
39
39
|
return Promise.resolve(false);
|
|
40
40
|
}
|
|
41
|
-
this.storage.setItem(
|
|
42
|
-
this.storage.removeItem(
|
|
41
|
+
this.storage.setItem(phone.STORAGE_AVAILABLE_KEY, '1');
|
|
42
|
+
this.storage.removeItem(phone.STORAGE_AVAILABLE_KEY);
|
|
43
43
|
return Promise.resolve(true);
|
|
44
44
|
}
|
|
45
45
|
catch (_a) {
|
|
@@ -86,7 +86,7 @@ var BrowserPersistenceClass = /** @class */ (function () {
|
|
|
86
86
|
*/
|
|
87
87
|
function _iframeCannotSyncWebStorage() {
|
|
88
88
|
var ua = util.getUA();
|
|
89
|
-
return
|
|
89
|
+
return phone._isSafari(ua) || phone._isIOS(ua);
|
|
90
90
|
}
|
|
91
91
|
// The polling period in case events are not supported
|
|
92
92
|
var _POLLING_INTERVAL_MS$1 = 1000;
|
|
@@ -103,9 +103,9 @@ var BrowserLocalPersistence = /** @class */ (function (_super) {
|
|
|
103
103
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
104
|
_this.pollTimer = null;
|
|
105
105
|
// Safari or iOS browser and embedded in an iframe.
|
|
106
|
-
_this.safariLocalStorageNotSynced = _iframeCannotSyncWebStorage() &&
|
|
106
|
+
_this.safariLocalStorageNotSynced = _iframeCannotSyncWebStorage() && phone._isIframe();
|
|
107
107
|
// Whether to use polling instead of depending on window events
|
|
108
|
-
_this.fallbackToPolling =
|
|
108
|
+
_this.fallbackToPolling = phone._isMobileBrowser();
|
|
109
109
|
_this._shouldAllowMigration = true;
|
|
110
110
|
return _this;
|
|
111
111
|
}
|
|
@@ -179,7 +179,7 @@ var BrowserLocalPersistence = /** @class */ (function (_super) {
|
|
|
179
179
|
_this.notifyListeners(key, storedValue);
|
|
180
180
|
};
|
|
181
181
|
var storedValue = this.storage.getItem(key);
|
|
182
|
-
if (
|
|
182
|
+
if (phone._isIE10() &&
|
|
183
183
|
storedValue !== event.newValue &&
|
|
184
184
|
event.newValue !== event.oldValue) {
|
|
185
185
|
// IE 10 has this weird bug where a storage event would trigger with the
|
|
@@ -670,85 +670,6 @@ var Sender = /** @class */ (function () {
|
|
|
670
670
|
return Sender;
|
|
671
671
|
}());
|
|
672
672
|
|
|
673
|
-
/**
|
|
674
|
-
* @license
|
|
675
|
-
* Copyright 2020 Google LLC
|
|
676
|
-
*
|
|
677
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
678
|
-
* you may not use this file except in compliance with the License.
|
|
679
|
-
* You may obtain a copy of the License at
|
|
680
|
-
*
|
|
681
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
682
|
-
*
|
|
683
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
684
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
685
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
686
|
-
* See the License for the specific language governing permissions and
|
|
687
|
-
* limitations under the License.
|
|
688
|
-
*/
|
|
689
|
-
/**
|
|
690
|
-
* Lazy accessor for window, since the compat layer won't tree shake this out,
|
|
691
|
-
* we need to make sure not to mess with window unless we have to
|
|
692
|
-
*/
|
|
693
|
-
function _window() {
|
|
694
|
-
return window;
|
|
695
|
-
}
|
|
696
|
-
function _setWindowLocation(url) {
|
|
697
|
-
_window().location.href = url;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
* @license
|
|
702
|
-
* Copyright 2020 Google LLC.
|
|
703
|
-
*
|
|
704
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
705
|
-
* you may not use this file except in compliance with the License.
|
|
706
|
-
* You may obtain a copy of the License at
|
|
707
|
-
*
|
|
708
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
709
|
-
*
|
|
710
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
711
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
712
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
713
|
-
* See the License for the specific language governing permissions and
|
|
714
|
-
* limitations under the License.
|
|
715
|
-
*/
|
|
716
|
-
function _isWorker() {
|
|
717
|
-
return (typeof _window()['WorkerGlobalScope'] !== 'undefined' &&
|
|
718
|
-
typeof _window()['importScripts'] === 'function');
|
|
719
|
-
}
|
|
720
|
-
function _getActiveServiceWorker() {
|
|
721
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
722
|
-
var registration;
|
|
723
|
-
return tslib.__generator(this, function (_b) {
|
|
724
|
-
switch (_b.label) {
|
|
725
|
-
case 0:
|
|
726
|
-
if (!(navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker)) {
|
|
727
|
-
return [2 /*return*/, null];
|
|
728
|
-
}
|
|
729
|
-
_b.label = 1;
|
|
730
|
-
case 1:
|
|
731
|
-
_b.trys.push([1, 3, , 4]);
|
|
732
|
-
return [4 /*yield*/, navigator.serviceWorker.ready];
|
|
733
|
-
case 2:
|
|
734
|
-
registration = _b.sent();
|
|
735
|
-
return [2 /*return*/, registration.active];
|
|
736
|
-
case 3:
|
|
737
|
-
_b.sent();
|
|
738
|
-
return [2 /*return*/, null];
|
|
739
|
-
case 4: return [2 /*return*/];
|
|
740
|
-
}
|
|
741
|
-
});
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
function _getServiceWorkerController() {
|
|
745
|
-
var _a;
|
|
746
|
-
return ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.serviceWorker) === null || _a === void 0 ? void 0 : _a.controller) || null;
|
|
747
|
-
}
|
|
748
|
-
function _getWorkerGlobalScope() {
|
|
749
|
-
return _isWorker() ? self : null;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
673
|
/**
|
|
753
674
|
* @license
|
|
754
675
|
* Copyright 2019 Google LLC
|
|
@@ -953,7 +874,7 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
|
|
|
953
874
|
IndexedDBLocalPersistence.prototype.initializeServiceWorkerMessaging = function () {
|
|
954
875
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
955
876
|
return tslib.__generator(this, function (_a) {
|
|
956
|
-
return [2 /*return*/, _isWorker() ? this.initializeReceiver() : this.initializeSender()];
|
|
877
|
+
return [2 /*return*/, phone._isWorker() ? this.initializeReceiver() : this.initializeSender()];
|
|
957
878
|
});
|
|
958
879
|
});
|
|
959
880
|
};
|
|
@@ -964,7 +885,7 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
|
|
|
964
885
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
965
886
|
var _this = this;
|
|
966
887
|
return tslib.__generator(this, function (_a) {
|
|
967
|
-
this.receiver = Receiver._getInstance(_getWorkerGlobalScope());
|
|
888
|
+
this.receiver = Receiver._getInstance(phone._getWorkerGlobalScope());
|
|
968
889
|
// Refresh from persistence if we receive a KeyChanged message.
|
|
969
890
|
this.receiver._subscribe("keyChanged" /* KEY_CHANGED */, function (_origin, data) { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
970
891
|
var keys;
|
|
@@ -1005,7 +926,7 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
|
|
|
1005
926
|
case 0:
|
|
1006
927
|
// Check to see if there's an active service worker.
|
|
1007
928
|
_c = this;
|
|
1008
|
-
return [4 /*yield*/, _getActiveServiceWorker()];
|
|
929
|
+
return [4 /*yield*/, phone._getActiveServiceWorker()];
|
|
1009
930
|
case 1:
|
|
1010
931
|
// Check to see if there's an active service worker.
|
|
1011
932
|
_c.activeServiceWorker = _d.sent();
|
|
@@ -1044,7 +965,7 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
|
|
|
1044
965
|
case 0:
|
|
1045
966
|
if (!this.sender ||
|
|
1046
967
|
!this.activeServiceWorker ||
|
|
1047
|
-
_getServiceWorkerController() !== this.activeServiceWorker) {
|
|
968
|
+
phone._getServiceWorkerController() !== this.activeServiceWorker) {
|
|
1048
969
|
return [2 /*return*/];
|
|
1049
970
|
}
|
|
1050
971
|
_b.label = 1;
|
|
@@ -1079,10 +1000,10 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
|
|
|
1079
1000
|
return [4 /*yield*/, _openDatabase()];
|
|
1080
1001
|
case 1:
|
|
1081
1002
|
db = _b.sent();
|
|
1082
|
-
return [4 /*yield*/, _putObject(db,
|
|
1003
|
+
return [4 /*yield*/, _putObject(db, phone.STORAGE_AVAILABLE_KEY, '1')];
|
|
1083
1004
|
case 2:
|
|
1084
1005
|
_b.sent();
|
|
1085
|
-
return [4 /*yield*/, _deleteObject(db,
|
|
1006
|
+
return [4 /*yield*/, _deleteObject(db, phone.STORAGE_AVAILABLE_KEY)];
|
|
1086
1007
|
case 3:
|
|
1087
1008
|
_b.sent();
|
|
1088
1009
|
return [2 /*return*/, true];
|
|
@@ -1119,1143 +1040,150 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
|
|
|
1119
1040
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1120
1041
|
var _this = this;
|
|
1121
1042
|
return tslib.__generator(this, function (_a) {
|
|
1122
|
-
return [2 /*return*/, this._withPendingWrite(function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
1123
|
-
return tslib.__generator(this, function (_a) {
|
|
1124
|
-
switch (_a.label) {
|
|
1125
|
-
case 0: return [4 /*yield*/, this._withRetries(function (db) { return _putObject(db, key, value); })];
|
|
1126
|
-
case 1:
|
|
1127
|
-
_a.sent();
|
|
1128
|
-
this.localCache[key] = value;
|
|
1129
|
-
return [2 /*return*/, this.notifyServiceWorker(key)];
|
|
1130
|
-
}
|
|
1131
|
-
});
|
|
1132
|
-
}); })];
|
|
1133
|
-
});
|
|
1134
|
-
});
|
|
1135
|
-
};
|
|
1136
|
-
IndexedDBLocalPersistence.prototype._get = function (key) {
|
|
1137
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1138
|
-
var obj;
|
|
1139
|
-
return tslib.__generator(this, function (_a) {
|
|
1140
|
-
switch (_a.label) {
|
|
1141
|
-
case 0: return [4 /*yield*/, this._withRetries(function (db) {
|
|
1142
|
-
return getObject(db, key);
|
|
1143
|
-
})];
|
|
1144
|
-
case 1:
|
|
1145
|
-
obj = (_a.sent());
|
|
1146
|
-
this.localCache[key] = obj;
|
|
1147
|
-
return [2 /*return*/, obj];
|
|
1148
|
-
}
|
|
1149
|
-
});
|
|
1150
|
-
});
|
|
1151
|
-
};
|
|
1152
|
-
IndexedDBLocalPersistence.prototype._remove = function (key) {
|
|
1153
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1154
|
-
var _this = this;
|
|
1155
|
-
return tslib.__generator(this, function (_a) {
|
|
1156
|
-
return [2 /*return*/, this._withPendingWrite(function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
1157
|
-
return tslib.__generator(this, function (_a) {
|
|
1158
|
-
switch (_a.label) {
|
|
1159
|
-
case 0: return [4 /*yield*/, this._withRetries(function (db) { return _deleteObject(db, key); })];
|
|
1160
|
-
case 1:
|
|
1161
|
-
_a.sent();
|
|
1162
|
-
delete this.localCache[key];
|
|
1163
|
-
return [2 /*return*/, this.notifyServiceWorker(key)];
|
|
1164
|
-
}
|
|
1165
|
-
});
|
|
1166
|
-
}); })];
|
|
1167
|
-
});
|
|
1168
|
-
});
|
|
1169
|
-
};
|
|
1170
|
-
IndexedDBLocalPersistence.prototype._poll = function () {
|
|
1171
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1172
|
-
var result, keys, keysInResult, _i, result_1, _a, key, value, _b, _c, localKey;
|
|
1173
|
-
return tslib.__generator(this, function (_d) {
|
|
1174
|
-
switch (_d.label) {
|
|
1175
|
-
case 0: return [4 /*yield*/, this._withRetries(function (db) {
|
|
1176
|
-
var getAllRequest = getObjectStore(db, false).getAll();
|
|
1177
|
-
return new DBPromise(getAllRequest).toPromise();
|
|
1178
|
-
})];
|
|
1179
|
-
case 1:
|
|
1180
|
-
result = _d.sent();
|
|
1181
|
-
if (!result) {
|
|
1182
|
-
return [2 /*return*/, []];
|
|
1183
|
-
}
|
|
1184
|
-
// If we have pending writes in progress abort, we'll get picked up on the next poll
|
|
1185
|
-
if (this.pendingWrites !== 0) {
|
|
1186
|
-
return [2 /*return*/, []];
|
|
1187
|
-
}
|
|
1188
|
-
keys = [];
|
|
1189
|
-
keysInResult = new Set();
|
|
1190
|
-
for (_i = 0, result_1 = result; _i < result_1.length; _i++) {
|
|
1191
|
-
_a = result_1[_i], key = _a.fbase_key, value = _a.value;
|
|
1192
|
-
keysInResult.add(key);
|
|
1193
|
-
if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {
|
|
1194
|
-
this.notifyListeners(key, value);
|
|
1195
|
-
keys.push(key);
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
for (_b = 0, _c = Object.keys(this.localCache); _b < _c.length; _b++) {
|
|
1199
|
-
localKey = _c[_b];
|
|
1200
|
-
if (this.localCache[localKey] && !keysInResult.has(localKey)) {
|
|
1201
|
-
// Deleted
|
|
1202
|
-
this.notifyListeners(localKey, null);
|
|
1203
|
-
keys.push(localKey);
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
return [2 /*return*/, keys];
|
|
1207
|
-
}
|
|
1208
|
-
});
|
|
1209
|
-
});
|
|
1210
|
-
};
|
|
1211
|
-
IndexedDBLocalPersistence.prototype.notifyListeners = function (key, newValue) {
|
|
1212
|
-
this.localCache[key] = newValue;
|
|
1213
|
-
var listeners = this.listeners[key];
|
|
1214
|
-
if (listeners) {
|
|
1215
|
-
for (var _i = 0, _a = Array.from(listeners); _i < _a.length; _i++) {
|
|
1216
|
-
var listener = _a[_i];
|
|
1217
|
-
listener(newValue);
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
};
|
|
1221
|
-
IndexedDBLocalPersistence.prototype.startPolling = function () {
|
|
1222
|
-
var _this = this;
|
|
1223
|
-
this.stopPolling();
|
|
1224
|
-
this.pollTimer = setInterval(function () { return tslib.__awaiter(_this, void 0, void 0, function () { return tslib.__generator(this, function (_a) {
|
|
1225
|
-
return [2 /*return*/, this._poll()];
|
|
1226
|
-
}); }); }, _POLLING_INTERVAL_MS);
|
|
1227
|
-
};
|
|
1228
|
-
IndexedDBLocalPersistence.prototype.stopPolling = function () {
|
|
1229
|
-
if (this.pollTimer) {
|
|
1230
|
-
clearInterval(this.pollTimer);
|
|
1231
|
-
this.pollTimer = null;
|
|
1232
|
-
}
|
|
1233
|
-
};
|
|
1234
|
-
IndexedDBLocalPersistence.prototype._addListener = function (key, listener) {
|
|
1235
|
-
if (Object.keys(this.listeners).length === 0) {
|
|
1236
|
-
this.startPolling();
|
|
1237
|
-
}
|
|
1238
|
-
if (!this.listeners[key]) {
|
|
1239
|
-
this.listeners[key] = new Set();
|
|
1240
|
-
// Populate the cache to avoid spuriously triggering on first poll.
|
|
1241
|
-
void this._get(key); // This can happen in the background async and we can return immediately.
|
|
1242
|
-
}
|
|
1243
|
-
this.listeners[key].add(listener);
|
|
1244
|
-
};
|
|
1245
|
-
IndexedDBLocalPersistence.prototype._removeListener = function (key, listener) {
|
|
1246
|
-
if (this.listeners[key]) {
|
|
1247
|
-
this.listeners[key].delete(listener);
|
|
1248
|
-
if (this.listeners[key].size === 0) {
|
|
1249
|
-
delete this.listeners[key];
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
if (Object.keys(this.listeners).length === 0) {
|
|
1253
|
-
this.stopPolling();
|
|
1254
|
-
}
|
|
1255
|
-
};
|
|
1256
|
-
IndexedDBLocalPersistence.type = 'LOCAL';
|
|
1257
|
-
return IndexedDBLocalPersistence;
|
|
1258
|
-
}());
|
|
1259
|
-
/**
|
|
1260
|
-
* An implementation of {@link Persistence} of type `LOCAL` using `indexedDB`
|
|
1261
|
-
* for the underlying storage.
|
|
1262
|
-
*
|
|
1263
|
-
* @public
|
|
1264
|
-
*/
|
|
1265
|
-
var indexedDBLocalPersistence = IndexedDBLocalPersistence;
|
|
1266
|
-
|
|
1267
|
-
/**
|
|
1268
|
-
* @license
|
|
1269
|
-
* Copyright 2020 Google LLC
|
|
1270
|
-
*
|
|
1271
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1272
|
-
* you may not use this file except in compliance with the License.
|
|
1273
|
-
* You may obtain a copy of the License at
|
|
1274
|
-
*
|
|
1275
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1276
|
-
*
|
|
1277
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1278
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1279
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1280
|
-
* See the License for the specific language governing permissions and
|
|
1281
|
-
* limitations under the License.
|
|
1282
|
-
*/
|
|
1283
|
-
function startSignInPhoneMfa(auth, request) {
|
|
1284
|
-
return enum_maps._performApiRequest(auth, "POST" /* POST */, "/v2/accounts/mfaSignIn:start" /* START_PHONE_MFA_SIGN_IN */, enum_maps._addTidIfNecessary(auth, request));
|
|
1285
|
-
}
|
|
1286
|
-
function finalizeSignInPhoneMfa(auth, request) {
|
|
1287
|
-
return enum_maps._performApiRequest(auth, "POST" /* POST */, "/v2/accounts/mfaSignIn:finalize" /* FINALIZE_PHONE_MFA_SIGN_IN */, enum_maps._addTidIfNecessary(auth, request));
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
/**
|
|
1291
|
-
* @license
|
|
1292
|
-
* Copyright 2020 Google LLC
|
|
1293
|
-
*
|
|
1294
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1295
|
-
* you may not use this file except in compliance with the License.
|
|
1296
|
-
* You may obtain a copy of the License at
|
|
1297
|
-
*
|
|
1298
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1299
|
-
*
|
|
1300
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1301
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1302
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1303
|
-
* See the License for the specific language governing permissions and
|
|
1304
|
-
* limitations under the License.
|
|
1305
|
-
*/
|
|
1306
|
-
function getRecaptchaParams(auth) {
|
|
1307
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1308
|
-
return tslib.__generator(this, function (_a) {
|
|
1309
|
-
switch (_a.label) {
|
|
1310
|
-
case 0: return [4 /*yield*/, enum_maps._performApiRequest(auth, "GET" /* GET */, "/v1/recaptchaParams" /* GET_RECAPTCHA_PARAM */)];
|
|
1311
|
-
case 1: return [2 /*return*/, ((_a.sent()).recaptchaSiteKey || '')];
|
|
1312
|
-
}
|
|
1313
|
-
});
|
|
1314
|
-
});
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
/**
|
|
1318
|
-
* @license
|
|
1319
|
-
* Copyright 2020 Google LLC
|
|
1320
|
-
*
|
|
1321
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1322
|
-
* you may not use this file except in compliance with the License.
|
|
1323
|
-
* You may obtain a copy of the License at
|
|
1324
|
-
*
|
|
1325
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1326
|
-
*
|
|
1327
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1328
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1329
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1330
|
-
* See the License for the specific language governing permissions and
|
|
1331
|
-
* limitations under the License.
|
|
1332
|
-
*/
|
|
1333
|
-
function getScriptParentElement() {
|
|
1334
|
-
var _a, _b;
|
|
1335
|
-
return (_b = (_a = document.getElementsByTagName('head')) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : document;
|
|
1336
|
-
}
|
|
1337
|
-
function _loadJS(url) {
|
|
1338
|
-
// TODO: consider adding timeout support & cancellation
|
|
1339
|
-
return new Promise(function (resolve, reject) {
|
|
1340
|
-
var el = document.createElement('script');
|
|
1341
|
-
el.setAttribute('src', url);
|
|
1342
|
-
el.onload = resolve;
|
|
1343
|
-
el.onerror = function (e) {
|
|
1344
|
-
var error = enum_maps._createError("internal-error" /* INTERNAL_ERROR */);
|
|
1345
|
-
error.customData = e;
|
|
1346
|
-
reject(error);
|
|
1347
|
-
};
|
|
1348
|
-
el.type = 'text/javascript';
|
|
1349
|
-
el.charset = 'UTF-8';
|
|
1350
|
-
getScriptParentElement().appendChild(el);
|
|
1351
|
-
});
|
|
1352
|
-
}
|
|
1353
|
-
function _generateCallbackName(prefix) {
|
|
1354
|
-
return "__" + prefix + Math.floor(Math.random() * 1000000);
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
/**
|
|
1358
|
-
* @license
|
|
1359
|
-
* Copyright 2020 Google LLC
|
|
1360
|
-
*
|
|
1361
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1362
|
-
* you may not use this file except in compliance with the License.
|
|
1363
|
-
* You may obtain a copy of the License at
|
|
1364
|
-
*
|
|
1365
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1366
|
-
*
|
|
1367
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1368
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1369
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1370
|
-
* See the License for the specific language governing permissions and
|
|
1371
|
-
* limitations under the License.
|
|
1372
|
-
*/
|
|
1373
|
-
var _SOLVE_TIME_MS = 500;
|
|
1374
|
-
var _EXPIRATION_TIME_MS = 60000;
|
|
1375
|
-
var _WIDGET_ID_START = 1000000000000;
|
|
1376
|
-
var MockReCaptcha = /** @class */ (function () {
|
|
1377
|
-
function MockReCaptcha(auth) {
|
|
1378
|
-
this.auth = auth;
|
|
1379
|
-
this.counter = _WIDGET_ID_START;
|
|
1380
|
-
this._widgets = new Map();
|
|
1381
|
-
}
|
|
1382
|
-
MockReCaptcha.prototype.render = function (container, parameters) {
|
|
1383
|
-
var id = this.counter;
|
|
1384
|
-
this._widgets.set(id, new MockWidget(container, this.auth.name, parameters || {}));
|
|
1385
|
-
this.counter++;
|
|
1386
|
-
return id;
|
|
1387
|
-
};
|
|
1388
|
-
MockReCaptcha.prototype.reset = function (optWidgetId) {
|
|
1389
|
-
var _a;
|
|
1390
|
-
var id = optWidgetId || _WIDGET_ID_START;
|
|
1391
|
-
void ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.delete());
|
|
1392
|
-
this._widgets.delete(id);
|
|
1393
|
-
};
|
|
1394
|
-
MockReCaptcha.prototype.getResponse = function (optWidgetId) {
|
|
1395
|
-
var _a;
|
|
1396
|
-
var id = optWidgetId || _WIDGET_ID_START;
|
|
1397
|
-
return ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.getResponse()) || '';
|
|
1398
|
-
};
|
|
1399
|
-
MockReCaptcha.prototype.execute = function (optWidgetId) {
|
|
1400
|
-
var _a;
|
|
1401
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1402
|
-
var id;
|
|
1403
|
-
return tslib.__generator(this, function (_b) {
|
|
1404
|
-
id = optWidgetId || _WIDGET_ID_START;
|
|
1405
|
-
void ((_a = this._widgets.get(id)) === null || _a === void 0 ? void 0 : _a.execute());
|
|
1406
|
-
return [2 /*return*/, ''];
|
|
1407
|
-
});
|
|
1408
|
-
});
|
|
1409
|
-
};
|
|
1410
|
-
return MockReCaptcha;
|
|
1411
|
-
}());
|
|
1412
|
-
var MockWidget = /** @class */ (function () {
|
|
1413
|
-
function MockWidget(containerOrId, appName, params) {
|
|
1414
|
-
var _this = this;
|
|
1415
|
-
this.params = params;
|
|
1416
|
-
this.timerId = null;
|
|
1417
|
-
this.deleted = false;
|
|
1418
|
-
this.responseToken = null;
|
|
1419
|
-
this.clickHandler = function () {
|
|
1420
|
-
_this.execute();
|
|
1421
|
-
};
|
|
1422
|
-
var container = typeof containerOrId === 'string'
|
|
1423
|
-
? document.getElementById(containerOrId)
|
|
1424
|
-
: containerOrId;
|
|
1425
|
-
enum_maps._assert(container, "argument-error" /* ARGUMENT_ERROR */, { appName: appName });
|
|
1426
|
-
this.container = container;
|
|
1427
|
-
this.isVisible = this.params.size !== 'invisible';
|
|
1428
|
-
if (this.isVisible) {
|
|
1429
|
-
this.execute();
|
|
1430
|
-
}
|
|
1431
|
-
else {
|
|
1432
|
-
this.container.addEventListener('click', this.clickHandler);
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
MockWidget.prototype.getResponse = function () {
|
|
1436
|
-
this.checkIfDeleted();
|
|
1437
|
-
return this.responseToken;
|
|
1438
|
-
};
|
|
1439
|
-
MockWidget.prototype.delete = function () {
|
|
1440
|
-
this.checkIfDeleted();
|
|
1441
|
-
this.deleted = true;
|
|
1442
|
-
if (this.timerId) {
|
|
1443
|
-
clearTimeout(this.timerId);
|
|
1444
|
-
this.timerId = null;
|
|
1445
|
-
}
|
|
1446
|
-
this.container.removeEventListener('click', this.clickHandler);
|
|
1447
|
-
};
|
|
1448
|
-
MockWidget.prototype.execute = function () {
|
|
1449
|
-
var _this = this;
|
|
1450
|
-
this.checkIfDeleted();
|
|
1451
|
-
if (this.timerId) {
|
|
1452
|
-
return;
|
|
1453
|
-
}
|
|
1454
|
-
this.timerId = window.setTimeout(function () {
|
|
1455
|
-
_this.responseToken = generateRandomAlphaNumericString(50);
|
|
1456
|
-
var _a = _this.params, callback = _a.callback, expiredCallback = _a["expired-callback"];
|
|
1457
|
-
if (callback) {
|
|
1458
|
-
try {
|
|
1459
|
-
callback(_this.responseToken);
|
|
1460
|
-
}
|
|
1461
|
-
catch (e) { }
|
|
1462
|
-
}
|
|
1463
|
-
_this.timerId = window.setTimeout(function () {
|
|
1464
|
-
_this.timerId = null;
|
|
1465
|
-
_this.responseToken = null;
|
|
1466
|
-
if (expiredCallback) {
|
|
1467
|
-
try {
|
|
1468
|
-
expiredCallback();
|
|
1469
|
-
}
|
|
1470
|
-
catch (e) { }
|
|
1471
|
-
}
|
|
1472
|
-
if (_this.isVisible) {
|
|
1473
|
-
_this.execute();
|
|
1474
|
-
}
|
|
1475
|
-
}, _EXPIRATION_TIME_MS);
|
|
1476
|
-
}, _SOLVE_TIME_MS);
|
|
1477
|
-
};
|
|
1478
|
-
MockWidget.prototype.checkIfDeleted = function () {
|
|
1479
|
-
if (this.deleted) {
|
|
1480
|
-
throw new Error('reCAPTCHA mock was already deleted!');
|
|
1481
|
-
}
|
|
1482
|
-
};
|
|
1483
|
-
return MockWidget;
|
|
1484
|
-
}());
|
|
1485
|
-
function generateRandomAlphaNumericString(len) {
|
|
1486
|
-
var chars = [];
|
|
1487
|
-
var allowedChars = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
1488
|
-
for (var i = 0; i < len; i++) {
|
|
1489
|
-
chars.push(allowedChars.charAt(Math.floor(Math.random() * allowedChars.length)));
|
|
1490
|
-
}
|
|
1491
|
-
return chars.join('');
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
/**
|
|
1495
|
-
* @license
|
|
1496
|
-
* Copyright 2020 Google LLC
|
|
1497
|
-
*
|
|
1498
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1499
|
-
* you may not use this file except in compliance with the License.
|
|
1500
|
-
* You may obtain a copy of the License at
|
|
1501
|
-
*
|
|
1502
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1503
|
-
*
|
|
1504
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1505
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1506
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1507
|
-
* See the License for the specific language governing permissions and
|
|
1508
|
-
* limitations under the License.
|
|
1509
|
-
*/
|
|
1510
|
-
// ReCaptcha will load using the same callback, so the callback function needs
|
|
1511
|
-
// to be kept around
|
|
1512
|
-
var _JSLOAD_CALLBACK = _generateCallbackName('rcb');
|
|
1513
|
-
var NETWORK_TIMEOUT_DELAY = new enum_maps.Delay(30000, 60000);
|
|
1514
|
-
var RECAPTCHA_BASE = 'https://www.google.com/recaptcha/api.js?';
|
|
1515
|
-
/**
|
|
1516
|
-
* Loader for the GReCaptcha library. There should only ever be one of this.
|
|
1517
|
-
*/
|
|
1518
|
-
var ReCaptchaLoaderImpl = /** @class */ (function () {
|
|
1519
|
-
function ReCaptchaLoaderImpl() {
|
|
1520
|
-
this.hostLanguage = '';
|
|
1521
|
-
this.counter = 0;
|
|
1522
|
-
this.librarySeparatelyLoaded = !!_window().grecaptcha;
|
|
1523
|
-
}
|
|
1524
|
-
ReCaptchaLoaderImpl.prototype.load = function (auth, hl) {
|
|
1525
|
-
var _this = this;
|
|
1526
|
-
if (hl === void 0) { hl = ''; }
|
|
1527
|
-
enum_maps._assert(isHostLanguageValid(hl), auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
1528
|
-
if (this.shouldResolveImmediately(hl)) {
|
|
1529
|
-
return Promise.resolve(_window().grecaptcha);
|
|
1530
|
-
}
|
|
1531
|
-
return new Promise(function (resolve, reject) {
|
|
1532
|
-
var networkTimeout = _window().setTimeout(function () {
|
|
1533
|
-
reject(enum_maps._createError(auth, "network-request-failed" /* NETWORK_REQUEST_FAILED */));
|
|
1534
|
-
}, NETWORK_TIMEOUT_DELAY.get());
|
|
1535
|
-
_window()[_JSLOAD_CALLBACK] = function () {
|
|
1536
|
-
_window().clearTimeout(networkTimeout);
|
|
1537
|
-
delete _window()[_JSLOAD_CALLBACK];
|
|
1538
|
-
var recaptcha = _window().grecaptcha;
|
|
1539
|
-
if (!recaptcha) {
|
|
1540
|
-
reject(enum_maps._createError(auth, "internal-error" /* INTERNAL_ERROR */));
|
|
1541
|
-
return;
|
|
1542
|
-
}
|
|
1543
|
-
// Wrap the greptcha render function so that we know if the developer has
|
|
1544
|
-
// called it separately
|
|
1545
|
-
var render = recaptcha.render;
|
|
1546
|
-
recaptcha.render = function (container, params) {
|
|
1547
|
-
var widgetId = render(container, params);
|
|
1548
|
-
_this.counter++;
|
|
1549
|
-
return widgetId;
|
|
1550
|
-
};
|
|
1551
|
-
_this.hostLanguage = hl;
|
|
1552
|
-
resolve(recaptcha);
|
|
1553
|
-
};
|
|
1554
|
-
var url = RECAPTCHA_BASE + "?" + util.querystring({
|
|
1555
|
-
onload: _JSLOAD_CALLBACK,
|
|
1556
|
-
render: 'explicit',
|
|
1557
|
-
hl: hl
|
|
1558
|
-
});
|
|
1559
|
-
_loadJS(url).catch(function () {
|
|
1560
|
-
clearTimeout(networkTimeout);
|
|
1561
|
-
reject(enum_maps._createError(auth, "internal-error" /* INTERNAL_ERROR */));
|
|
1562
|
-
});
|
|
1563
|
-
});
|
|
1564
|
-
};
|
|
1565
|
-
ReCaptchaLoaderImpl.prototype.clearedOneInstance = function () {
|
|
1566
|
-
this.counter--;
|
|
1567
|
-
};
|
|
1568
|
-
ReCaptchaLoaderImpl.prototype.shouldResolveImmediately = function (hl) {
|
|
1569
|
-
// We can resolve immediately if:
|
|
1570
|
-
// • grecaptcha is already defined AND (
|
|
1571
|
-
// 1. the requested language codes are the same OR
|
|
1572
|
-
// 2. there exists already a ReCaptcha on the page
|
|
1573
|
-
// 3. the library was already loaded by the app
|
|
1574
|
-
// In cases (2) and (3), we _can't_ reload as it would break the recaptchas
|
|
1575
|
-
// that are already in the page
|
|
1576
|
-
return (!!_window().grecaptcha &&
|
|
1577
|
-
(hl === this.hostLanguage ||
|
|
1578
|
-
this.counter > 0 ||
|
|
1579
|
-
this.librarySeparatelyLoaded));
|
|
1580
|
-
};
|
|
1581
|
-
return ReCaptchaLoaderImpl;
|
|
1582
|
-
}());
|
|
1583
|
-
function isHostLanguageValid(hl) {
|
|
1584
|
-
return hl.length <= 6 && /^\s*[a-zA-Z0-9\-]*\s*$/.test(hl);
|
|
1585
|
-
}
|
|
1586
|
-
var MockReCaptchaLoaderImpl = /** @class */ (function () {
|
|
1587
|
-
function MockReCaptchaLoaderImpl() {
|
|
1588
|
-
}
|
|
1589
|
-
MockReCaptchaLoaderImpl.prototype.load = function (auth) {
|
|
1590
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1591
|
-
return tslib.__generator(this, function (_a) {
|
|
1592
|
-
return [2 /*return*/, new MockReCaptcha(auth)];
|
|
1593
|
-
});
|
|
1594
|
-
});
|
|
1595
|
-
};
|
|
1596
|
-
MockReCaptchaLoaderImpl.prototype.clearedOneInstance = function () { };
|
|
1597
|
-
return MockReCaptchaLoaderImpl;
|
|
1598
|
-
}());
|
|
1599
|
-
|
|
1600
|
-
/**
|
|
1601
|
-
* @license
|
|
1602
|
-
* Copyright 2020 Google LLC
|
|
1603
|
-
*
|
|
1604
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1605
|
-
* you may not use this file except in compliance with the License.
|
|
1606
|
-
* You may obtain a copy of the License at
|
|
1607
|
-
*
|
|
1608
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1609
|
-
*
|
|
1610
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1611
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1612
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1613
|
-
* See the License for the specific language governing permissions and
|
|
1614
|
-
* limitations under the License.
|
|
1615
|
-
*/
|
|
1616
|
-
var RECAPTCHA_VERIFIER_TYPE = 'recaptcha';
|
|
1617
|
-
var DEFAULT_PARAMS = {
|
|
1618
|
-
theme: 'light',
|
|
1619
|
-
type: 'image'
|
|
1620
|
-
};
|
|
1621
|
-
/**
|
|
1622
|
-
* An {@link https://www.google.com/recaptcha/ | reCAPTCHA}-based application verifier.
|
|
1623
|
-
*
|
|
1624
|
-
* @public
|
|
1625
|
-
*/
|
|
1626
|
-
var RecaptchaVerifier = /** @class */ (function () {
|
|
1627
|
-
/**
|
|
1628
|
-
*
|
|
1629
|
-
* @param containerOrId - The reCAPTCHA container parameter.
|
|
1630
|
-
*
|
|
1631
|
-
* @remarks
|
|
1632
|
-
* This has different meaning depending on whether the reCAPTCHA is hidden or visible. For a
|
|
1633
|
-
* visible reCAPTCHA the container must be empty. If a string is used, it has to correspond to
|
|
1634
|
-
* an element ID. The corresponding element must also must be in the DOM at the time of
|
|
1635
|
-
* initialization.
|
|
1636
|
-
*
|
|
1637
|
-
* @param parameters - The optional reCAPTCHA parameters.
|
|
1638
|
-
*
|
|
1639
|
-
* @remarks
|
|
1640
|
-
* Check the reCAPTCHA docs for a comprehensive list. All parameters are accepted except for
|
|
1641
|
-
* the sitekey. Firebase Auth backend provisions a reCAPTCHA for each project and will
|
|
1642
|
-
* configure this upon rendering. For an invisible reCAPTCHA, a size key must have the value
|
|
1643
|
-
* 'invisible'.
|
|
1644
|
-
*
|
|
1645
|
-
* @param authExtern - The corresponding Firebase {@link Auth} instance.
|
|
1646
|
-
*
|
|
1647
|
-
* @remarks
|
|
1648
|
-
* If none is provided, the default Firebase {@link Auth} instance is used. A Firebase {@link Auth} instance
|
|
1649
|
-
* must be initialized with an API key, otherwise an error will be thrown.
|
|
1650
|
-
*/
|
|
1651
|
-
function RecaptchaVerifier(containerOrId, parameters, authExtern) {
|
|
1652
|
-
if (parameters === void 0) { parameters = tslib.__assign({}, DEFAULT_PARAMS); }
|
|
1653
|
-
this.parameters = parameters;
|
|
1654
|
-
/**
|
|
1655
|
-
* The application verifier type.
|
|
1656
|
-
*
|
|
1657
|
-
* @remarks
|
|
1658
|
-
* For a reCAPTCHA verifier, this is 'recaptcha'.
|
|
1659
|
-
*/
|
|
1660
|
-
this.type = RECAPTCHA_VERIFIER_TYPE;
|
|
1661
|
-
this.destroyed = false;
|
|
1662
|
-
this.widgetId = null;
|
|
1663
|
-
this.tokenChangeListeners = new Set();
|
|
1664
|
-
this.renderPromise = null;
|
|
1665
|
-
this.recaptcha = null;
|
|
1666
|
-
this.auth = enum_maps._castAuth(authExtern);
|
|
1667
|
-
this.isInvisible = this.parameters.size === 'invisible';
|
|
1668
|
-
enum_maps._assert(typeof document !== 'undefined', this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
1669
|
-
var container = typeof containerOrId === 'string'
|
|
1670
|
-
? document.getElementById(containerOrId)
|
|
1671
|
-
: containerOrId;
|
|
1672
|
-
enum_maps._assert(container, this.auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
1673
|
-
this.container = container;
|
|
1674
|
-
this.parameters.callback = this.makeTokenCallback(this.parameters.callback);
|
|
1675
|
-
this._recaptchaLoader = this.auth.settings.appVerificationDisabledForTesting
|
|
1676
|
-
? new MockReCaptchaLoaderImpl()
|
|
1677
|
-
: new ReCaptchaLoaderImpl();
|
|
1678
|
-
this.validateStartingState();
|
|
1679
|
-
// TODO: Figure out if sdk version is needed
|
|
1680
|
-
}
|
|
1681
|
-
/**
|
|
1682
|
-
* Waits for the user to solve the reCAPTCHA and resolves with the reCAPTCHA token.
|
|
1683
|
-
*
|
|
1684
|
-
* @returns A Promise for the reCAPTCHA token.
|
|
1685
|
-
*/
|
|
1686
|
-
RecaptchaVerifier.prototype.verify = function () {
|
|
1687
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1688
|
-
var id, recaptcha, response;
|
|
1689
|
-
var _this = this;
|
|
1690
|
-
return tslib.__generator(this, function (_a) {
|
|
1691
|
-
switch (_a.label) {
|
|
1692
|
-
case 0:
|
|
1693
|
-
this.assertNotDestroyed();
|
|
1694
|
-
return [4 /*yield*/, this.render()];
|
|
1695
|
-
case 1:
|
|
1696
|
-
id = _a.sent();
|
|
1697
|
-
recaptcha = this.getAssertedRecaptcha();
|
|
1698
|
-
response = recaptcha.getResponse(id);
|
|
1699
|
-
if (response) {
|
|
1700
|
-
return [2 /*return*/, response];
|
|
1701
|
-
}
|
|
1702
|
-
return [2 /*return*/, new Promise(function (resolve) {
|
|
1703
|
-
var tokenChange = function (token) {
|
|
1704
|
-
if (!token) {
|
|
1705
|
-
return; // Ignore token expirations.
|
|
1706
|
-
}
|
|
1707
|
-
_this.tokenChangeListeners.delete(tokenChange);
|
|
1708
|
-
resolve(token);
|
|
1709
|
-
};
|
|
1710
|
-
_this.tokenChangeListeners.add(tokenChange);
|
|
1711
|
-
if (_this.isInvisible) {
|
|
1712
|
-
recaptcha.execute(id);
|
|
1713
|
-
}
|
|
1714
|
-
})];
|
|
1715
|
-
}
|
|
1716
|
-
});
|
|
1717
|
-
});
|
|
1718
|
-
};
|
|
1719
|
-
/**
|
|
1720
|
-
* Renders the reCAPTCHA widget on the page.
|
|
1721
|
-
*
|
|
1722
|
-
* @returns A Promise that resolves with the reCAPTCHA widget ID.
|
|
1723
|
-
*/
|
|
1724
|
-
RecaptchaVerifier.prototype.render = function () {
|
|
1725
|
-
var _this = this;
|
|
1726
|
-
try {
|
|
1727
|
-
this.assertNotDestroyed();
|
|
1728
|
-
}
|
|
1729
|
-
catch (e) {
|
|
1730
|
-
// This method returns a promise. Since it's not async (we want to return the
|
|
1731
|
-
// _same_ promise if rendering is still occurring), the API surface should
|
|
1732
|
-
// reject with the error rather than just throw
|
|
1733
|
-
return Promise.reject(e);
|
|
1734
|
-
}
|
|
1735
|
-
if (this.renderPromise) {
|
|
1736
|
-
return this.renderPromise;
|
|
1737
|
-
}
|
|
1738
|
-
this.renderPromise = this.makeRenderPromise().catch(function (e) {
|
|
1739
|
-
_this.renderPromise = null;
|
|
1740
|
-
throw e;
|
|
1741
|
-
});
|
|
1742
|
-
return this.renderPromise;
|
|
1743
|
-
};
|
|
1744
|
-
/** @internal */
|
|
1745
|
-
RecaptchaVerifier.prototype._reset = function () {
|
|
1746
|
-
this.assertNotDestroyed();
|
|
1747
|
-
if (this.widgetId !== null) {
|
|
1748
|
-
this.getAssertedRecaptcha().reset(this.widgetId);
|
|
1749
|
-
}
|
|
1750
|
-
};
|
|
1751
|
-
/**
|
|
1752
|
-
* Clears the reCAPTCHA widget from the page and destroys the instance.
|
|
1753
|
-
*/
|
|
1754
|
-
RecaptchaVerifier.prototype.clear = function () {
|
|
1755
|
-
var _this = this;
|
|
1756
|
-
this.assertNotDestroyed();
|
|
1757
|
-
this.destroyed = true;
|
|
1758
|
-
this._recaptchaLoader.clearedOneInstance();
|
|
1759
|
-
if (!this.isInvisible) {
|
|
1760
|
-
this.container.childNodes.forEach(function (node) {
|
|
1761
|
-
_this.container.removeChild(node);
|
|
1762
|
-
});
|
|
1763
|
-
}
|
|
1764
|
-
};
|
|
1765
|
-
RecaptchaVerifier.prototype.validateStartingState = function () {
|
|
1766
|
-
enum_maps._assert(!this.parameters.sitekey, this.auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
1767
|
-
enum_maps._assert(this.isInvisible || !this.container.hasChildNodes(), this.auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
1768
|
-
enum_maps._assert(typeof document !== 'undefined', this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
1769
|
-
};
|
|
1770
|
-
RecaptchaVerifier.prototype.makeTokenCallback = function (existing) {
|
|
1771
|
-
var _this = this;
|
|
1772
|
-
return function (token) {
|
|
1773
|
-
_this.tokenChangeListeners.forEach(function (listener) { return listener(token); });
|
|
1774
|
-
if (typeof existing === 'function') {
|
|
1775
|
-
existing(token);
|
|
1776
|
-
}
|
|
1777
|
-
else if (typeof existing === 'string') {
|
|
1778
|
-
var globalFunc = _window()[existing];
|
|
1779
|
-
if (typeof globalFunc === 'function') {
|
|
1780
|
-
globalFunc(token);
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1783
|
-
};
|
|
1784
|
-
};
|
|
1785
|
-
RecaptchaVerifier.prototype.assertNotDestroyed = function () {
|
|
1786
|
-
enum_maps._assert(!this.destroyed, this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1787
|
-
};
|
|
1788
|
-
RecaptchaVerifier.prototype.makeRenderPromise = function () {
|
|
1789
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1790
|
-
var container, guaranteedEmpty;
|
|
1791
|
-
return tslib.__generator(this, function (_a) {
|
|
1792
|
-
switch (_a.label) {
|
|
1793
|
-
case 0: return [4 /*yield*/, this.init()];
|
|
1794
|
-
case 1:
|
|
1795
|
-
_a.sent();
|
|
1796
|
-
if (!this.widgetId) {
|
|
1797
|
-
container = this.container;
|
|
1798
|
-
if (!this.isInvisible) {
|
|
1799
|
-
guaranteedEmpty = document.createElement('div');
|
|
1800
|
-
container.appendChild(guaranteedEmpty);
|
|
1801
|
-
container = guaranteedEmpty;
|
|
1802
|
-
}
|
|
1803
|
-
this.widgetId = this.getAssertedRecaptcha().render(container, this.parameters);
|
|
1804
|
-
}
|
|
1805
|
-
return [2 /*return*/, this.widgetId];
|
|
1806
|
-
}
|
|
1807
|
-
});
|
|
1808
|
-
});
|
|
1809
|
-
};
|
|
1810
|
-
RecaptchaVerifier.prototype.init = function () {
|
|
1811
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1812
|
-
var _a, siteKey;
|
|
1813
|
-
return tslib.__generator(this, function (_b) {
|
|
1814
|
-
switch (_b.label) {
|
|
1815
|
-
case 0:
|
|
1816
|
-
enum_maps._assert(enum_maps._isHttpOrHttps() && !_isWorker(), this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1817
|
-
return [4 /*yield*/, domReady()];
|
|
1818
|
-
case 1:
|
|
1819
|
-
_b.sent();
|
|
1820
|
-
_a = this;
|
|
1821
|
-
return [4 /*yield*/, this._recaptchaLoader.load(this.auth, this.auth.languageCode || undefined)];
|
|
1822
|
-
case 2:
|
|
1823
|
-
_a.recaptcha = _b.sent();
|
|
1824
|
-
return [4 /*yield*/, getRecaptchaParams(this.auth)];
|
|
1825
|
-
case 3:
|
|
1826
|
-
siteKey = _b.sent();
|
|
1827
|
-
enum_maps._assert(siteKey, this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1828
|
-
this.parameters.sitekey = siteKey;
|
|
1829
|
-
return [2 /*return*/];
|
|
1830
|
-
}
|
|
1831
|
-
});
|
|
1832
|
-
});
|
|
1833
|
-
};
|
|
1834
|
-
RecaptchaVerifier.prototype.getAssertedRecaptcha = function () {
|
|
1835
|
-
enum_maps._assert(this.recaptcha, this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1836
|
-
return this.recaptcha;
|
|
1837
|
-
};
|
|
1838
|
-
return RecaptchaVerifier;
|
|
1839
|
-
}());
|
|
1840
|
-
function domReady() {
|
|
1841
|
-
var resolver = null;
|
|
1842
|
-
return new Promise(function (resolve) {
|
|
1843
|
-
if (document.readyState === 'complete') {
|
|
1844
|
-
resolve();
|
|
1845
|
-
return;
|
|
1846
|
-
}
|
|
1847
|
-
// Document not ready, wait for load before resolving.
|
|
1848
|
-
// Save resolver, so we can remove listener in case it was externally
|
|
1849
|
-
// cancelled.
|
|
1850
|
-
resolver = function () { return resolve(); };
|
|
1851
|
-
window.addEventListener('load', resolver);
|
|
1852
|
-
}).catch(function (e) {
|
|
1853
|
-
if (resolver) {
|
|
1854
|
-
window.removeEventListener('load', resolver);
|
|
1855
|
-
}
|
|
1856
|
-
throw e;
|
|
1857
|
-
});
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
/**
|
|
1861
|
-
* @license
|
|
1862
|
-
* Copyright 2020 Google LLC
|
|
1863
|
-
*
|
|
1864
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1865
|
-
* you may not use this file except in compliance with the License.
|
|
1866
|
-
* You may obtain a copy of the License at
|
|
1867
|
-
*
|
|
1868
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1869
|
-
*
|
|
1870
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1871
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1872
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1873
|
-
* See the License for the specific language governing permissions and
|
|
1874
|
-
* limitations under the License.
|
|
1875
|
-
*/
|
|
1876
|
-
var ConfirmationResultImpl = /** @class */ (function () {
|
|
1877
|
-
function ConfirmationResultImpl(verificationId, onConfirmation) {
|
|
1878
|
-
this.verificationId = verificationId;
|
|
1879
|
-
this.onConfirmation = onConfirmation;
|
|
1880
|
-
}
|
|
1881
|
-
ConfirmationResultImpl.prototype.confirm = function (verificationCode) {
|
|
1882
|
-
var authCredential = enum_maps.PhoneAuthCredential._fromVerification(this.verificationId, verificationCode);
|
|
1883
|
-
return this.onConfirmation(authCredential);
|
|
1884
|
-
};
|
|
1885
|
-
return ConfirmationResultImpl;
|
|
1886
|
-
}());
|
|
1887
|
-
/**
|
|
1888
|
-
* Asynchronously signs in using a phone number.
|
|
1889
|
-
*
|
|
1890
|
-
* @remarks
|
|
1891
|
-
* This method sends a code via SMS to the given
|
|
1892
|
-
* phone number, and returns a {@link ConfirmationResult}. After the user
|
|
1893
|
-
* provides the code sent to their phone, call {@link ConfirmationResult.confirm}
|
|
1894
|
-
* with the code to sign the user in.
|
|
1895
|
-
*
|
|
1896
|
-
* For abuse prevention, this method also requires a {@link ApplicationVerifier}.
|
|
1897
|
-
* This SDK includes a reCAPTCHA-based implementation, {@link RecaptchaVerifier}.
|
|
1898
|
-
*
|
|
1899
|
-
* @example
|
|
1900
|
-
* ```javascript
|
|
1901
|
-
* // 'recaptcha-container' is the ID of an element in the DOM.
|
|
1902
|
-
* const applicationVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');
|
|
1903
|
-
* const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);
|
|
1904
|
-
* // Obtain a verificationCode from the user.
|
|
1905
|
-
* const credential = await confirmationResult.confirm(verificationCode);
|
|
1906
|
-
* ```
|
|
1907
|
-
*
|
|
1908
|
-
* @param auth - The {@link Auth} instance.
|
|
1909
|
-
* @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).
|
|
1910
|
-
* @param appVerifier - The {@link ApplicationVerifier}.
|
|
1911
|
-
*
|
|
1912
|
-
* @public
|
|
1913
|
-
*/
|
|
1914
|
-
function signInWithPhoneNumber(auth, phoneNumber, appVerifier) {
|
|
1915
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1916
|
-
var authInternal, verificationId;
|
|
1917
|
-
return tslib.__generator(this, function (_a) {
|
|
1918
|
-
switch (_a.label) {
|
|
1919
|
-
case 0:
|
|
1920
|
-
authInternal = enum_maps._castAuth(auth);
|
|
1921
|
-
return [4 /*yield*/, _verifyPhoneNumber(authInternal, phoneNumber, util.getModularInstance(appVerifier))];
|
|
1922
|
-
case 1:
|
|
1923
|
-
verificationId = _a.sent();
|
|
1924
|
-
return [2 /*return*/, new ConfirmationResultImpl(verificationId, function (cred) {
|
|
1925
|
-
return enum_maps.signInWithCredential(authInternal, cred);
|
|
1926
|
-
})];
|
|
1927
|
-
}
|
|
1928
|
-
});
|
|
1929
|
-
});
|
|
1930
|
-
}
|
|
1931
|
-
/**
|
|
1932
|
-
* Links the user account with the given phone number.
|
|
1933
|
-
*
|
|
1934
|
-
* @param user - The user.
|
|
1935
|
-
* @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).
|
|
1936
|
-
* @param appVerifier - The {@link ApplicationVerifier}.
|
|
1937
|
-
*
|
|
1938
|
-
* @public
|
|
1939
|
-
*/
|
|
1940
|
-
function linkWithPhoneNumber(user, phoneNumber, appVerifier) {
|
|
1941
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1942
|
-
var userInternal, verificationId;
|
|
1943
|
-
return tslib.__generator(this, function (_a) {
|
|
1944
|
-
switch (_a.label) {
|
|
1945
|
-
case 0:
|
|
1946
|
-
userInternal = util.getModularInstance(user);
|
|
1947
|
-
return [4 /*yield*/, enum_maps._assertLinkedStatus(false, userInternal, "phone" /* PHONE */)];
|
|
1948
|
-
case 1:
|
|
1949
|
-
_a.sent();
|
|
1950
|
-
return [4 /*yield*/, _verifyPhoneNumber(userInternal.auth, phoneNumber, util.getModularInstance(appVerifier))];
|
|
1951
|
-
case 2:
|
|
1952
|
-
verificationId = _a.sent();
|
|
1953
|
-
return [2 /*return*/, new ConfirmationResultImpl(verificationId, function (cred) {
|
|
1954
|
-
return enum_maps.linkWithCredential(userInternal, cred);
|
|
1955
|
-
})];
|
|
1956
|
-
}
|
|
1957
|
-
});
|
|
1958
|
-
});
|
|
1959
|
-
}
|
|
1960
|
-
/**
|
|
1961
|
-
* Re-authenticates a user using a fresh phone credential.
|
|
1962
|
-
*
|
|
1963
|
-
* @remarks Use before operations such as {@link updatePassword} that require tokens from recent sign-in attempts.
|
|
1964
|
-
*
|
|
1965
|
-
* @param user - The user.
|
|
1966
|
-
* @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).
|
|
1967
|
-
* @param appVerifier - The {@link ApplicationVerifier}.
|
|
1968
|
-
*
|
|
1969
|
-
* @public
|
|
1970
|
-
*/
|
|
1971
|
-
function reauthenticateWithPhoneNumber(user, phoneNumber, appVerifier) {
|
|
1972
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1973
|
-
var userInternal, verificationId;
|
|
1974
|
-
return tslib.__generator(this, function (_a) {
|
|
1975
|
-
switch (_a.label) {
|
|
1976
|
-
case 0:
|
|
1977
|
-
userInternal = util.getModularInstance(user);
|
|
1978
|
-
return [4 /*yield*/, _verifyPhoneNumber(userInternal.auth, phoneNumber, util.getModularInstance(appVerifier))];
|
|
1979
|
-
case 1:
|
|
1980
|
-
verificationId = _a.sent();
|
|
1981
|
-
return [2 /*return*/, new ConfirmationResultImpl(verificationId, function (cred) {
|
|
1982
|
-
return enum_maps.reauthenticateWithCredential(userInternal, cred);
|
|
1043
|
+
return [2 /*return*/, this._withPendingWrite(function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
1044
|
+
return tslib.__generator(this, function (_a) {
|
|
1045
|
+
switch (_a.label) {
|
|
1046
|
+
case 0: return [4 /*yield*/, this._withRetries(function (db) { return _putObject(db, key, value); })];
|
|
1047
|
+
case 1:
|
|
1048
|
+
_a.sent();
|
|
1049
|
+
this.localCache[key] = value;
|
|
1050
|
+
return [2 /*return*/, this.notifyServiceWorker(key)];
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
}); })];
|
|
1054
|
+
});
|
|
1055
|
+
});
|
|
1056
|
+
};
|
|
1057
|
+
IndexedDBLocalPersistence.prototype._get = function (key) {
|
|
1058
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1059
|
+
var obj;
|
|
1060
|
+
return tslib.__generator(this, function (_a) {
|
|
1061
|
+
switch (_a.label) {
|
|
1062
|
+
case 0: return [4 /*yield*/, this._withRetries(function (db) {
|
|
1063
|
+
return getObject(db, key);
|
|
1983
1064
|
})];
|
|
1984
|
-
|
|
1065
|
+
case 1:
|
|
1066
|
+
obj = (_a.sent());
|
|
1067
|
+
this.localCache[key] = obj;
|
|
1068
|
+
return [2 /*return*/, obj];
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1985
1071
|
});
|
|
1986
|
-
}
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
case 1:
|
|
2000
|
-
recaptchaToken = _b.sent();
|
|
2001
|
-
_b.label = 2;
|
|
2002
|
-
case 2:
|
|
2003
|
-
_b.trys.push([2, , 10, 11]);
|
|
2004
|
-
enum_maps._assert(typeof recaptchaToken === 'string', auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
2005
|
-
enum_maps._assert(verifier.type === RECAPTCHA_VERIFIER_TYPE, auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
2006
|
-
phoneInfoOptions = void 0;
|
|
2007
|
-
if (typeof options === 'string') {
|
|
2008
|
-
phoneInfoOptions = {
|
|
2009
|
-
phoneNumber: options
|
|
2010
|
-
};
|
|
2011
|
-
}
|
|
2012
|
-
else {
|
|
2013
|
-
phoneInfoOptions = options;
|
|
2014
|
-
}
|
|
2015
|
-
if (!('session' in phoneInfoOptions)) return [3 /*break*/, 7];
|
|
2016
|
-
session = phoneInfoOptions.session;
|
|
2017
|
-
if (!('phoneNumber' in phoneInfoOptions)) return [3 /*break*/, 4];
|
|
2018
|
-
enum_maps._assert(session.type === "enroll" /* ENROLL */, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
2019
|
-
return [4 /*yield*/, enum_maps.startEnrollPhoneMfa(auth, {
|
|
2020
|
-
idToken: session.credential,
|
|
2021
|
-
phoneEnrollmentInfo: {
|
|
2022
|
-
phoneNumber: phoneInfoOptions.phoneNumber,
|
|
2023
|
-
recaptchaToken: recaptchaToken
|
|
1072
|
+
};
|
|
1073
|
+
IndexedDBLocalPersistence.prototype._remove = function (key) {
|
|
1074
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1075
|
+
var _this = this;
|
|
1076
|
+
return tslib.__generator(this, function (_a) {
|
|
1077
|
+
return [2 /*return*/, this._withPendingWrite(function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
1078
|
+
return tslib.__generator(this, function (_a) {
|
|
1079
|
+
switch (_a.label) {
|
|
1080
|
+
case 0: return [4 /*yield*/, this._withRetries(function (db) { return _deleteObject(db, key); })];
|
|
1081
|
+
case 1:
|
|
1082
|
+
_a.sent();
|
|
1083
|
+
delete this.localCache[key];
|
|
1084
|
+
return [2 /*return*/, this.notifyServiceWorker(key)];
|
|
2024
1085
|
}
|
|
1086
|
+
});
|
|
1087
|
+
}); })];
|
|
1088
|
+
});
|
|
1089
|
+
});
|
|
1090
|
+
};
|
|
1091
|
+
IndexedDBLocalPersistence.prototype._poll = function () {
|
|
1092
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1093
|
+
var result, keys, keysInResult, _i, result_1, _a, key, value, _b, _c, localKey;
|
|
1094
|
+
return tslib.__generator(this, function (_d) {
|
|
1095
|
+
switch (_d.label) {
|
|
1096
|
+
case 0: return [4 /*yield*/, this._withRetries(function (db) {
|
|
1097
|
+
var getAllRequest = getObjectStore(db, false).getAll();
|
|
1098
|
+
return new DBPromise(getAllRequest).toPromise();
|
|
2025
1099
|
})];
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
1100
|
+
case 1:
|
|
1101
|
+
result = _d.sent();
|
|
1102
|
+
if (!result) {
|
|
1103
|
+
return [2 /*return*/, []];
|
|
1104
|
+
}
|
|
1105
|
+
// If we have pending writes in progress abort, we'll get picked up on the next poll
|
|
1106
|
+
if (this.pendingWrites !== 0) {
|
|
1107
|
+
return [2 /*return*/, []];
|
|
1108
|
+
}
|
|
1109
|
+
keys = [];
|
|
1110
|
+
keysInResult = new Set();
|
|
1111
|
+
for (_i = 0, result_1 = result; _i < result_1.length; _i++) {
|
|
1112
|
+
_a = result_1[_i], key = _a.fbase_key, value = _a.value;
|
|
1113
|
+
keysInResult.add(key);
|
|
1114
|
+
if (JSON.stringify(this.localCache[key]) !== JSON.stringify(value)) {
|
|
1115
|
+
this.notifyListeners(key, value);
|
|
1116
|
+
keys.push(key);
|
|
2039
1117
|
}
|
|
2040
|
-
}
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
case 9: return [3 /*break*/, 11];
|
|
2053
|
-
case 10:
|
|
2054
|
-
verifier._reset();
|
|
2055
|
-
return [7 /*endfinally*/];
|
|
2056
|
-
case 11: return [2 /*return*/];
|
|
2057
|
-
}
|
|
1118
|
+
}
|
|
1119
|
+
for (_b = 0, _c = Object.keys(this.localCache); _b < _c.length; _b++) {
|
|
1120
|
+
localKey = _c[_b];
|
|
1121
|
+
if (this.localCache[localKey] && !keysInResult.has(localKey)) {
|
|
1122
|
+
// Deleted
|
|
1123
|
+
this.notifyListeners(localKey, null);
|
|
1124
|
+
keys.push(localKey);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
return [2 /*return*/, keys];
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
2058
1130
|
});
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
* const applicationVerifier = new RecaptchaVerifier('recaptcha-container');
|
|
2068
|
-
* const provider = new PhoneAuthProvider(auth);
|
|
2069
|
-
* const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);
|
|
2070
|
-
* // Obtain the verificationCode from the user.
|
|
2071
|
-
* const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);
|
|
2072
|
-
* await updatePhoneNumber(user, phoneCredential);
|
|
2073
|
-
* ```
|
|
2074
|
-
*
|
|
2075
|
-
* @param user - The user.
|
|
2076
|
-
* @param credential - A credential authenticating the new phone number.
|
|
2077
|
-
*
|
|
2078
|
-
* @public
|
|
2079
|
-
*/
|
|
2080
|
-
function updatePhoneNumber(user, credential) {
|
|
2081
|
-
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2082
|
-
return tslib.__generator(this, function (_a) {
|
|
2083
|
-
switch (_a.label) {
|
|
2084
|
-
case 0: return [4 /*yield*/, enum_maps._link(util.getModularInstance(user), credential)];
|
|
2085
|
-
case 1:
|
|
2086
|
-
_a.sent();
|
|
2087
|
-
return [2 /*return*/];
|
|
1131
|
+
};
|
|
1132
|
+
IndexedDBLocalPersistence.prototype.notifyListeners = function (key, newValue) {
|
|
1133
|
+
this.localCache[key] = newValue;
|
|
1134
|
+
var listeners = this.listeners[key];
|
|
1135
|
+
if (listeners) {
|
|
1136
|
+
for (var _i = 0, _a = Array.from(listeners); _i < _a.length; _i++) {
|
|
1137
|
+
var listener = _a[_i];
|
|
1138
|
+
listener(newValue);
|
|
2088
1139
|
}
|
|
2089
|
-
}
|
|
2090
|
-
});
|
|
2091
|
-
}
|
|
2092
|
-
|
|
2093
|
-
/**
|
|
2094
|
-
* @license
|
|
2095
|
-
* Copyright 2020 Google LLC
|
|
2096
|
-
*
|
|
2097
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2098
|
-
* you may not use this file except in compliance with the License.
|
|
2099
|
-
* You may obtain a copy of the License at
|
|
2100
|
-
*
|
|
2101
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2102
|
-
*
|
|
2103
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2104
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2105
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2106
|
-
* See the License for the specific language governing permissions and
|
|
2107
|
-
* limitations under the License.
|
|
2108
|
-
*/
|
|
2109
|
-
/**
|
|
2110
|
-
* Provider for generating an {@link PhoneAuthCredential}.
|
|
2111
|
-
*
|
|
2112
|
-
* @example
|
|
2113
|
-
* ```javascript
|
|
2114
|
-
* // 'recaptcha-container' is the ID of an element in the DOM.
|
|
2115
|
-
* const applicationVerifier = new RecaptchaVerifier('recaptcha-container');
|
|
2116
|
-
* const provider = new PhoneAuthProvider(auth);
|
|
2117
|
-
* const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);
|
|
2118
|
-
* // Obtain the verificationCode from the user.
|
|
2119
|
-
* const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);
|
|
2120
|
-
* const userCredential = await signInWithCredential(auth, phoneCredential);
|
|
2121
|
-
* ```
|
|
2122
|
-
*
|
|
2123
|
-
* @public
|
|
2124
|
-
*/
|
|
2125
|
-
var PhoneAuthProvider = /** @class */ (function () {
|
|
2126
|
-
/**
|
|
2127
|
-
* @param auth - The Firebase {@link Auth} instance in which sign-ins should occur.
|
|
2128
|
-
*
|
|
2129
|
-
*/
|
|
2130
|
-
function PhoneAuthProvider(auth) {
|
|
2131
|
-
/** Always set to {@link ProviderId}.PHONE. */
|
|
2132
|
-
this.providerId = PhoneAuthProvider.PROVIDER_ID;
|
|
2133
|
-
this.auth = enum_maps._castAuth(auth);
|
|
2134
|
-
}
|
|
2135
|
-
/**
|
|
2136
|
-
*
|
|
2137
|
-
* Starts a phone number authentication flow by sending a verification code to the given phone
|
|
2138
|
-
* number.
|
|
2139
|
-
*
|
|
2140
|
-
* @example
|
|
2141
|
-
* ```javascript
|
|
2142
|
-
* const provider = new PhoneAuthProvider(auth);
|
|
2143
|
-
* const verificationId = await provider.verifyPhoneNumber(phoneNumber, applicationVerifier);
|
|
2144
|
-
* // Obtain verificationCode from the user.
|
|
2145
|
-
* const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);
|
|
2146
|
-
* const userCredential = await signInWithCredential(auth, authCredential);
|
|
2147
|
-
* ```
|
|
2148
|
-
*
|
|
2149
|
-
* @example
|
|
2150
|
-
* An alternative flow is provided using the `signInWithPhoneNumber` method.
|
|
2151
|
-
* ```javascript
|
|
2152
|
-
* const confirmationResult = signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);
|
|
2153
|
-
* // Obtain verificationCode from the user.
|
|
2154
|
-
* const userCredential = confirmationResult.confirm(verificationCode);
|
|
2155
|
-
* ```
|
|
2156
|
-
*
|
|
2157
|
-
* @param phoneInfoOptions - The user's {@link PhoneInfoOptions}. The phone number should be in
|
|
2158
|
-
* E.164 format (e.g. +16505550101).
|
|
2159
|
-
* @param applicationVerifier - For abuse prevention, this method also requires a
|
|
2160
|
-
* {@link ApplicationVerifier}. This SDK includes a reCAPTCHA-based implementation,
|
|
2161
|
-
* {@link RecaptchaVerifier}.
|
|
2162
|
-
*
|
|
2163
|
-
* @returns A Promise for a verification ID that can be passed to
|
|
2164
|
-
* {@link PhoneAuthProvider.credential} to identify this flow..
|
|
2165
|
-
*/
|
|
2166
|
-
PhoneAuthProvider.prototype.verifyPhoneNumber = function (phoneOptions, applicationVerifier) {
|
|
2167
|
-
return _verifyPhoneNumber(this.auth, phoneOptions, util.getModularInstance(applicationVerifier));
|
|
1140
|
+
}
|
|
2168
1141
|
};
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
* ```javascript
|
|
2176
|
-
* const provider = new PhoneAuthProvider(auth);
|
|
2177
|
-
* const verificationId = provider.verifyPhoneNumber(phoneNumber, applicationVerifier);
|
|
2178
|
-
* // Obtain verificationCode from the user.
|
|
2179
|
-
* const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);
|
|
2180
|
-
* const userCredential = signInWithCredential(auth, authCredential);
|
|
2181
|
-
* ```
|
|
2182
|
-
*
|
|
2183
|
-
* @example
|
|
2184
|
-
* An alternative flow is provided using the `signInWithPhoneNumber` method.
|
|
2185
|
-
* ```javascript
|
|
2186
|
-
* const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);
|
|
2187
|
-
* // Obtain verificationCode from the user.
|
|
2188
|
-
* const userCredential = await confirmationResult.confirm(verificationCode);
|
|
2189
|
-
* ```
|
|
2190
|
-
*
|
|
2191
|
-
* @param verificationId - The verification ID returned from {@link PhoneAuthProvider.verifyPhoneNumber}.
|
|
2192
|
-
* @param verificationCode - The verification code sent to the user's mobile device.
|
|
2193
|
-
*
|
|
2194
|
-
* @returns The auth provider credential.
|
|
2195
|
-
*/
|
|
2196
|
-
PhoneAuthProvider.credential = function (verificationId, verificationCode) {
|
|
2197
|
-
return enum_maps.PhoneAuthCredential._fromVerification(verificationId, verificationCode);
|
|
1142
|
+
IndexedDBLocalPersistence.prototype.startPolling = function () {
|
|
1143
|
+
var _this = this;
|
|
1144
|
+
this.stopPolling();
|
|
1145
|
+
this.pollTimer = setInterval(function () { return tslib.__awaiter(_this, void 0, void 0, function () { return tslib.__generator(this, function (_a) {
|
|
1146
|
+
return [2 /*return*/, this._poll()];
|
|
1147
|
+
}); }); }, _POLLING_INTERVAL_MS);
|
|
2198
1148
|
};
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
var credential = userCredential;
|
|
2205
|
-
return PhoneAuthProvider.credentialFromTaggedObject(credential);
|
|
1149
|
+
IndexedDBLocalPersistence.prototype.stopPolling = function () {
|
|
1150
|
+
if (this.pollTimer) {
|
|
1151
|
+
clearInterval(this.pollTimer);
|
|
1152
|
+
this.pollTimer = null;
|
|
1153
|
+
}
|
|
2206
1154
|
};
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
* fails, links the user with the account associated with that number:
|
|
2218
|
-
*
|
|
2219
|
-
* ```js
|
|
2220
|
-
* const provider = new PhoneAuthProvider(auth);
|
|
2221
|
-
* const verificationId = await provider.verifyPhoneNumber(number, verifier);
|
|
2222
|
-
* try {
|
|
2223
|
-
* const code = ''; // Prompt the user for the verification code
|
|
2224
|
-
* await updatePhoneNumber(
|
|
2225
|
-
* auth.currentUser,
|
|
2226
|
-
* PhoneAuthProvider.credential(verificationId, code));
|
|
2227
|
-
* } catch (e) {
|
|
2228
|
-
* if (e.code === 'auth/account-exists-with-different-credential') {
|
|
2229
|
-
* const cred = PhoneAuthProvider.credentialFromError(e);
|
|
2230
|
-
* await linkWithCredential(auth.currentUser, cred);
|
|
2231
|
-
* }
|
|
2232
|
-
* }
|
|
2233
|
-
*
|
|
2234
|
-
* // At this point, auth.currentUser.phoneNumber === number.
|
|
2235
|
-
* ```
|
|
2236
|
-
*
|
|
2237
|
-
* @param error - The error to generate a credential from.
|
|
2238
|
-
*/
|
|
2239
|
-
PhoneAuthProvider.credentialFromError = function (error) {
|
|
2240
|
-
return PhoneAuthProvider.credentialFromTaggedObject((error.customData || {}));
|
|
1155
|
+
IndexedDBLocalPersistence.prototype._addListener = function (key, listener) {
|
|
1156
|
+
if (Object.keys(this.listeners).length === 0) {
|
|
1157
|
+
this.startPolling();
|
|
1158
|
+
}
|
|
1159
|
+
if (!this.listeners[key]) {
|
|
1160
|
+
this.listeners[key] = new Set();
|
|
1161
|
+
// Populate the cache to avoid spuriously triggering on first poll.
|
|
1162
|
+
void this._get(key); // This can happen in the background async and we can return immediately.
|
|
1163
|
+
}
|
|
1164
|
+
this.listeners[key].add(listener);
|
|
2241
1165
|
};
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
1166
|
+
IndexedDBLocalPersistence.prototype._removeListener = function (key, listener) {
|
|
1167
|
+
if (this.listeners[key]) {
|
|
1168
|
+
this.listeners[key].delete(listener);
|
|
1169
|
+
if (this.listeners[key].size === 0) {
|
|
1170
|
+
delete this.listeners[key];
|
|
1171
|
+
}
|
|
2246
1172
|
}
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
return enum_maps.PhoneAuthCredential._fromTokenResponse(phoneNumber, temporaryProof);
|
|
1173
|
+
if (Object.keys(this.listeners).length === 0) {
|
|
1174
|
+
this.stopPolling();
|
|
2250
1175
|
}
|
|
2251
|
-
return null;
|
|
2252
1176
|
};
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
1177
|
+
IndexedDBLocalPersistence.type = 'LOCAL';
|
|
1178
|
+
return IndexedDBLocalPersistence;
|
|
1179
|
+
}());
|
|
1180
|
+
/**
|
|
1181
|
+
* An implementation of {@link Persistence} of type `LOCAL` using `indexedDB`
|
|
1182
|
+
* for the underlying storage.
|
|
1183
|
+
*
|
|
1184
|
+
* @public
|
|
1185
|
+
*/
|
|
1186
|
+
var indexedDBLocalPersistence = IndexedDBLocalPersistence;
|
|
2259
1187
|
|
|
2260
1188
|
/**
|
|
2261
1189
|
* @license
|
|
@@ -2280,9 +1208,9 @@ var PhoneAuthProvider = /** @class */ (function () {
|
|
|
2280
1208
|
*/
|
|
2281
1209
|
function _withDefaultResolver(auth, resolverOverride) {
|
|
2282
1210
|
if (resolverOverride) {
|
|
2283
|
-
return
|
|
1211
|
+
return phone._getInstance(resolverOverride);
|
|
2284
1212
|
}
|
|
2285
|
-
|
|
1213
|
+
phone._assert(auth._popupRedirectResolver, auth, "argument-error" /* ARGUMENT_ERROR */);
|
|
2286
1214
|
return auth._popupRedirectResolver;
|
|
2287
1215
|
}
|
|
2288
1216
|
|
|
@@ -2310,13 +1238,13 @@ var IdpCredential = /** @class */ (function (_super) {
|
|
|
2310
1238
|
return _this;
|
|
2311
1239
|
}
|
|
2312
1240
|
IdpCredential.prototype._getIdTokenResponse = function (auth) {
|
|
2313
|
-
return
|
|
1241
|
+
return phone.signInWithIdp(auth, this._buildIdpRequest());
|
|
2314
1242
|
};
|
|
2315
1243
|
IdpCredential.prototype._linkToIdToken = function (auth, idToken) {
|
|
2316
|
-
return
|
|
1244
|
+
return phone.signInWithIdp(auth, this._buildIdpRequest(idToken));
|
|
2317
1245
|
};
|
|
2318
1246
|
IdpCredential.prototype._getReauthenticationResolver = function (auth) {
|
|
2319
|
-
return
|
|
1247
|
+
return phone.signInWithIdp(auth, this._buildIdpRequest());
|
|
2320
1248
|
};
|
|
2321
1249
|
IdpCredential.prototype._buildIdpRequest = function (idToken) {
|
|
2322
1250
|
var request = {
|
|
@@ -2334,22 +1262,22 @@ var IdpCredential = /** @class */ (function (_super) {
|
|
|
2334
1262
|
return request;
|
|
2335
1263
|
};
|
|
2336
1264
|
return IdpCredential;
|
|
2337
|
-
}(
|
|
1265
|
+
}(phone.AuthCredential));
|
|
2338
1266
|
function _signIn(params) {
|
|
2339
|
-
return
|
|
1267
|
+
return phone._signInWithCredential(params.auth, new IdpCredential(params), params.bypassAuthState);
|
|
2340
1268
|
}
|
|
2341
1269
|
function _reauth(params) {
|
|
2342
1270
|
var auth = params.auth, user = params.user;
|
|
2343
|
-
|
|
2344
|
-
return
|
|
1271
|
+
phone._assert(user, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1272
|
+
return phone._reauthenticate(user, new IdpCredential(params), params.bypassAuthState);
|
|
2345
1273
|
}
|
|
2346
1274
|
function _link(params) {
|
|
2347
1275
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2348
1276
|
var auth, user;
|
|
2349
1277
|
return tslib.__generator(this, function (_a) {
|
|
2350
1278
|
auth = params.auth, user = params.user;
|
|
2351
|
-
|
|
2352
|
-
return [2 /*return*/,
|
|
1279
|
+
phone._assert(user, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
1280
|
+
return [2 /*return*/, phone._link(user, new IdpCredential(params), params.bypassAuthState)];
|
|
2353
1281
|
});
|
|
2354
1282
|
});
|
|
2355
1283
|
}
|
|
@@ -2466,16 +1394,16 @@ var AbstractPopupRedirectOperation = /** @class */ (function () {
|
|
|
2466
1394
|
case "reauthViaRedirect" /* REAUTH_VIA_REDIRECT */:
|
|
2467
1395
|
return _reauth;
|
|
2468
1396
|
default:
|
|
2469
|
-
|
|
1397
|
+
phone._fail(this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
2470
1398
|
}
|
|
2471
1399
|
};
|
|
2472
1400
|
AbstractPopupRedirectOperation.prototype.resolve = function (cred) {
|
|
2473
|
-
|
|
1401
|
+
phone.debugAssert(this.pendingPromise, 'Pending promise was never set');
|
|
2474
1402
|
this.pendingPromise.resolve(cred);
|
|
2475
1403
|
this.unregisterAndCleanUp();
|
|
2476
1404
|
};
|
|
2477
1405
|
AbstractPopupRedirectOperation.prototype.reject = function (error) {
|
|
2478
|
-
|
|
1406
|
+
phone.debugAssert(this.pendingPromise, 'Pending promise was never set');
|
|
2479
1407
|
this.pendingPromise.reject(error);
|
|
2480
1408
|
this.unregisterAndCleanUp();
|
|
2481
1409
|
};
|
|
@@ -2505,7 +1433,7 @@ var AbstractPopupRedirectOperation = /** @class */ (function () {
|
|
|
2505
1433
|
* See the License for the specific language governing permissions and
|
|
2506
1434
|
* limitations under the License.
|
|
2507
1435
|
*/
|
|
2508
|
-
var _POLL_WINDOW_CLOSE_TIMEOUT = new
|
|
1436
|
+
var _POLL_WINDOW_CLOSE_TIMEOUT = new phone.Delay(2000, 10000);
|
|
2509
1437
|
/**
|
|
2510
1438
|
* Authenticates a Firebase client using a popup-based OAuth authentication flow.
|
|
2511
1439
|
*
|
|
@@ -2539,8 +1467,8 @@ function signInWithPopup(auth, provider, resolver) {
|
|
|
2539
1467
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2540
1468
|
var authInternal, resolverInternal, action;
|
|
2541
1469
|
return tslib.__generator(this, function (_a) {
|
|
2542
|
-
authInternal =
|
|
2543
|
-
|
|
1470
|
+
authInternal = phone._castAuth(auth);
|
|
1471
|
+
phone._assertInstanceOf(auth, provider, phone.FederatedAuthProvider);
|
|
2544
1472
|
resolverInternal = _withDefaultResolver(authInternal, resolver);
|
|
2545
1473
|
action = new PopupOperation(authInternal, "signInViaPopup" /* SIGN_IN_VIA_POPUP */, provider, resolverInternal);
|
|
2546
1474
|
return [2 /*return*/, action.executeNotNull()];
|
|
@@ -2577,7 +1505,7 @@ function reauthenticateWithPopup(user, provider, resolver) {
|
|
|
2577
1505
|
var userInternal, resolverInternal, action;
|
|
2578
1506
|
return tslib.__generator(this, function (_a) {
|
|
2579
1507
|
userInternal = util.getModularInstance(user);
|
|
2580
|
-
|
|
1508
|
+
phone._assertInstanceOf(userInternal.auth, provider, phone.FederatedAuthProvider);
|
|
2581
1509
|
resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
|
|
2582
1510
|
action = new PopupOperation(userInternal.auth, "reauthViaPopup" /* REAUTH_VIA_POPUP */, provider, resolverInternal, userInternal);
|
|
2583
1511
|
return [2 /*return*/, action.executeNotNull()];
|
|
@@ -2613,7 +1541,7 @@ function linkWithPopup(user, provider, resolver) {
|
|
|
2613
1541
|
var userInternal, resolverInternal, action;
|
|
2614
1542
|
return tslib.__generator(this, function (_a) {
|
|
2615
1543
|
userInternal = util.getModularInstance(user);
|
|
2616
|
-
|
|
1544
|
+
phone._assertInstanceOf(userInternal.auth, provider, phone.FederatedAuthProvider);
|
|
2617
1545
|
resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
|
|
2618
1546
|
action = new PopupOperation(userInternal.auth, "linkViaPopup" /* LINK_VIA_POPUP */, provider, resolverInternal, userInternal);
|
|
2619
1547
|
return [2 /*return*/, action.executeNotNull()];
|
|
@@ -2646,7 +1574,7 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
2646
1574
|
case 0: return [4 /*yield*/, this.execute()];
|
|
2647
1575
|
case 1:
|
|
2648
1576
|
result = _a.sent();
|
|
2649
|
-
|
|
1577
|
+
phone._assert(result, this.auth, "internal-error" /* INTERNAL_ERROR */);
|
|
2650
1578
|
return [2 /*return*/, result];
|
|
2651
1579
|
}
|
|
2652
1580
|
});
|
|
@@ -2659,7 +1587,7 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
2659
1587
|
return tslib.__generator(this, function (_b) {
|
|
2660
1588
|
switch (_b.label) {
|
|
2661
1589
|
case 0:
|
|
2662
|
-
|
|
1590
|
+
phone.debugAssert(this.filter.length === 1, 'Popup operations only handle one event');
|
|
2663
1591
|
eventId = _generateEventId();
|
|
2664
1592
|
_a = this;
|
|
2665
1593
|
return [4 /*yield*/, this.resolver._openPopup(this.auth, this.provider, this.filter[0], // There's always one, see constructor
|
|
@@ -2679,7 +1607,7 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
2679
1607
|
});
|
|
2680
1608
|
this.resolver._isIframeWebStorageSupported(this.auth, function (isSupported) {
|
|
2681
1609
|
if (!isSupported) {
|
|
2682
|
-
_this.reject(
|
|
1610
|
+
_this.reject(phone._createError(_this.auth, "web-storage-unsupported" /* WEB_STORAGE_UNSUPPORTED */));
|
|
2683
1611
|
}
|
|
2684
1612
|
});
|
|
2685
1613
|
// Handle user closure. Notice this does *not* use await
|
|
@@ -2698,7 +1626,7 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
2698
1626
|
configurable: true
|
|
2699
1627
|
});
|
|
2700
1628
|
PopupOperation.prototype.cancel = function () {
|
|
2701
|
-
this.reject(
|
|
1629
|
+
this.reject(phone._createError(this.auth, "cancelled-popup-request" /* EXPIRED_POPUP_REQUEST */));
|
|
2702
1630
|
};
|
|
2703
1631
|
PopupOperation.prototype.cleanUp = function () {
|
|
2704
1632
|
if (this.authWindow) {
|
|
@@ -2721,7 +1649,7 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
2721
1649
|
// call could still be in flight.
|
|
2722
1650
|
_this.pollId = window.setTimeout(function () {
|
|
2723
1651
|
_this.pollId = null;
|
|
2724
|
-
_this.reject(
|
|
1652
|
+
_this.reject(phone._createError(_this.auth, "popup-closed-by-user" /* POPUP_CLOSED_BY_USER */));
|
|
2725
1653
|
}, 2000 /* AUTH_EVENT */);
|
|
2726
1654
|
return;
|
|
2727
1655
|
}
|
|
@@ -2890,10 +1818,10 @@ function _clearRedirectOutcomes() {
|
|
|
2890
1818
|
redirectOutcomeMap.clear();
|
|
2891
1819
|
}
|
|
2892
1820
|
function resolverPersistence(resolver) {
|
|
2893
|
-
return
|
|
1821
|
+
return phone._getInstance(resolver._redirectPersistence);
|
|
2894
1822
|
}
|
|
2895
1823
|
function pendingRedirectKey(auth) {
|
|
2896
|
-
return
|
|
1824
|
+
return phone._persistenceKeyName(PENDING_REDIRECT_KEY, auth.config.apiKey, auth.name);
|
|
2897
1825
|
}
|
|
2898
1826
|
|
|
2899
1827
|
/**
|
|
@@ -2960,8 +1888,8 @@ function _signInWithRedirect(auth, provider, resolver) {
|
|
|
2960
1888
|
return tslib.__generator(this, function (_a) {
|
|
2961
1889
|
switch (_a.label) {
|
|
2962
1890
|
case 0:
|
|
2963
|
-
authInternal =
|
|
2964
|
-
|
|
1891
|
+
authInternal = phone._castAuth(auth);
|
|
1892
|
+
phone._assertInstanceOf(auth, provider, phone.FederatedAuthProvider);
|
|
2965
1893
|
resolverInternal = _withDefaultResolver(authInternal, resolver);
|
|
2966
1894
|
return [4 /*yield*/, _setPendingRedirectStatus(resolverInternal, authInternal)];
|
|
2967
1895
|
case 1:
|
|
@@ -3009,7 +1937,7 @@ function _reauthenticateWithRedirect(user, provider, resolver) {
|
|
|
3009
1937
|
switch (_a.label) {
|
|
3010
1938
|
case 0:
|
|
3011
1939
|
userInternal = util.getModularInstance(user);
|
|
3012
|
-
|
|
1940
|
+
phone._assertInstanceOf(userInternal.auth, provider, phone.FederatedAuthProvider);
|
|
3013
1941
|
resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
|
|
3014
1942
|
return [4 /*yield*/, _setPendingRedirectStatus(resolverInternal, userInternal.auth)];
|
|
3015
1943
|
case 1:
|
|
@@ -3057,9 +1985,9 @@ function _linkWithRedirect(user, provider, resolver) {
|
|
|
3057
1985
|
switch (_a.label) {
|
|
3058
1986
|
case 0:
|
|
3059
1987
|
userInternal = util.getModularInstance(user);
|
|
3060
|
-
|
|
1988
|
+
phone._assertInstanceOf(userInternal.auth, provider, phone.FederatedAuthProvider);
|
|
3061
1989
|
resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
|
|
3062
|
-
return [4 /*yield*/,
|
|
1990
|
+
return [4 /*yield*/, phone._assertLinkedStatus(false, userInternal, provider.providerId)];
|
|
3063
1991
|
case 1:
|
|
3064
1992
|
_a.sent();
|
|
3065
1993
|
return [4 /*yield*/, _setPendingRedirectStatus(resolverInternal, userInternal.auth)];
|
|
@@ -3116,7 +2044,7 @@ function getRedirectResult(auth, resolver) {
|
|
|
3116
2044
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
3117
2045
|
return tslib.__generator(this, function (_a) {
|
|
3118
2046
|
switch (_a.label) {
|
|
3119
|
-
case 0: return [4 /*yield*/,
|
|
2047
|
+
case 0: return [4 /*yield*/, phone._castAuth(auth)._initializationPromise];
|
|
3120
2048
|
case 1:
|
|
3121
2049
|
_a.sent();
|
|
3122
2050
|
return [2 /*return*/, _getRedirectResult(auth, resolver, false)];
|
|
@@ -3131,7 +2059,7 @@ function _getRedirectResult(auth, resolverExtern, bypassAuthState) {
|
|
|
3131
2059
|
return tslib.__generator(this, function (_a) {
|
|
3132
2060
|
switch (_a.label) {
|
|
3133
2061
|
case 0:
|
|
3134
|
-
authInternal =
|
|
2062
|
+
authInternal = phone._castAuth(auth);
|
|
3135
2063
|
resolver = _withDefaultResolver(authInternal, resolverExtern);
|
|
3136
2064
|
action = new RedirectAction(authInternal, resolver, bypassAuthState);
|
|
3137
2065
|
return [4 /*yield*/, action.execute()];
|
|
@@ -3243,7 +2171,7 @@ var AuthEventManager = /** @class */ (function () {
|
|
|
3243
2171
|
if (event.error && !isNullRedirectEvent(event)) {
|
|
3244
2172
|
var code = ((_a = event.error.code) === null || _a === void 0 ? void 0 : _a.split('auth/')[1]) ||
|
|
3245
2173
|
"internal-error" /* INTERNAL_ERROR */;
|
|
3246
|
-
consumer.onError(
|
|
2174
|
+
consumer.onError(phone._createError(this.auth, code));
|
|
3247
2175
|
}
|
|
3248
2176
|
else {
|
|
3249
2177
|
consumer.onAuthEvent(event);
|
|
@@ -3308,7 +2236,7 @@ function _getProjectConfig(auth, request) {
|
|
|
3308
2236
|
if (request === void 0) { request = {}; }
|
|
3309
2237
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
3310
2238
|
return tslib.__generator(this, function (_a) {
|
|
3311
|
-
return [2 /*return*/,
|
|
2239
|
+
return [2 /*return*/, phone._performApiRequest(auth, "GET" /* GET */, "/v1/projects" /* GET_PROJECT_CONFIG */, request)];
|
|
3312
2240
|
});
|
|
3313
2241
|
});
|
|
3314
2242
|
}
|
|
@@ -3356,14 +2284,14 @@ function _validateOrigin$1(auth) {
|
|
|
3356
2284
|
}
|
|
3357
2285
|
}
|
|
3358
2286
|
// In the old SDK, this error also provides helpful messages.
|
|
3359
|
-
|
|
2287
|
+
phone._fail(auth, "unauthorized-domain" /* INVALID_ORIGIN */);
|
|
3360
2288
|
return [2 /*return*/];
|
|
3361
2289
|
}
|
|
3362
2290
|
});
|
|
3363
2291
|
});
|
|
3364
2292
|
}
|
|
3365
2293
|
function matchDomain(expected) {
|
|
3366
|
-
var currentUrl =
|
|
2294
|
+
var currentUrl = phone._getCurrentUrl();
|
|
3367
2295
|
var _a = new URL(currentUrl), protocol = _a.protocol, hostname = _a.hostname;
|
|
3368
2296
|
if (expected.startsWith('chrome-extension://')) {
|
|
3369
2297
|
var ceUrl = new URL(expected);
|
|
@@ -3407,7 +2335,7 @@ function matchDomain(expected) {
|
|
|
3407
2335
|
* See the License for the specific language governing permissions and
|
|
3408
2336
|
* limitations under the License.
|
|
3409
2337
|
*/
|
|
3410
|
-
var NETWORK_TIMEOUT = new
|
|
2338
|
+
var NETWORK_TIMEOUT = new phone.Delay(30000, 60000);
|
|
3411
2339
|
/**
|
|
3412
2340
|
* Reset unlaoded GApi modules. If gapi.load fails due to a network error,
|
|
3413
2341
|
* it will stop working after a retrial. This is a hack to fix this issue.
|
|
@@ -3416,7 +2344,7 @@ function resetUnloadedGapiModules() {
|
|
|
3416
2344
|
// Clear last failed gapi.load state to force next gapi.load to first
|
|
3417
2345
|
// load the failed gapi.iframes module.
|
|
3418
2346
|
// Get gapix.beacon context.
|
|
3419
|
-
var beacon = _window().___jsl;
|
|
2347
|
+
var beacon = phone._window().___jsl;
|
|
3420
2348
|
// Get current hint.
|
|
3421
2349
|
if (beacon === null || beacon === void 0 ? void 0 : beacon.H) {
|
|
3422
2350
|
// Get gapi hint.
|
|
@@ -3458,16 +2386,16 @@ function loadGapi(auth) {
|
|
|
3458
2386
|
// failed attempt.
|
|
3459
2387
|
// Timeout when gapi.iframes.Iframe not loaded.
|
|
3460
2388
|
resetUnloadedGapiModules();
|
|
3461
|
-
reject(
|
|
2389
|
+
reject(phone._createError(auth, "network-request-failed" /* NETWORK_REQUEST_FAILED */));
|
|
3462
2390
|
},
|
|
3463
2391
|
timeout: NETWORK_TIMEOUT.get()
|
|
3464
2392
|
});
|
|
3465
2393
|
}
|
|
3466
|
-
if ((_b = (_a = _window().gapi) === null || _a === void 0 ? void 0 : _a.iframes) === null || _b === void 0 ? void 0 : _b.Iframe) {
|
|
2394
|
+
if ((_b = (_a = phone._window().gapi) === null || _a === void 0 ? void 0 : _a.iframes) === null || _b === void 0 ? void 0 : _b.Iframe) {
|
|
3467
2395
|
// If gapi.iframes.Iframe available, resolve.
|
|
3468
2396
|
resolve(gapi.iframes.getContext());
|
|
3469
2397
|
}
|
|
3470
|
-
else if (!!((_c = _window().gapi) === null || _c === void 0 ? void 0 : _c.load)) {
|
|
2398
|
+
else if (!!((_c = phone._window().gapi) === null || _c === void 0 ? void 0 : _c.load)) {
|
|
3471
2399
|
// Gapi loader ready, load gapi.iframes.
|
|
3472
2400
|
loadGapiIframe();
|
|
3473
2401
|
}
|
|
@@ -3477,20 +2405,20 @@ function loadGapi(auth) {
|
|
|
3477
2405
|
// multiple times in parallel and could result in the later callback
|
|
3478
2406
|
// overwriting the previous one. This would end up with a iframe
|
|
3479
2407
|
// timeout.
|
|
3480
|
-
var cbName = _generateCallbackName('iframefcb');
|
|
2408
|
+
var cbName = phone._generateCallbackName('iframefcb');
|
|
3481
2409
|
// GApi loader not available, dynamically load platform.js.
|
|
3482
|
-
_window()[cbName] = function () {
|
|
2410
|
+
phone._window()[cbName] = function () {
|
|
3483
2411
|
// GApi loader should be ready.
|
|
3484
2412
|
if (!!gapi.load) {
|
|
3485
2413
|
loadGapiIframe();
|
|
3486
2414
|
}
|
|
3487
2415
|
else {
|
|
3488
2416
|
// Gapi loader failed, throw error.
|
|
3489
|
-
reject(
|
|
2417
|
+
reject(phone._createError(auth, "network-request-failed" /* NETWORK_REQUEST_FAILED */));
|
|
3490
2418
|
}
|
|
3491
2419
|
};
|
|
3492
2420
|
// Load GApi loader.
|
|
3493
|
-
return _loadJS("https://apis.google.com/js/api.js?onload=" + cbName);
|
|
2421
|
+
return phone._loadJS("https://apis.google.com/js/api.js?onload=" + cbName);
|
|
3494
2422
|
}
|
|
3495
2423
|
}).catch(function (error) {
|
|
3496
2424
|
// Reset cached promise to allow for retrial.
|
|
@@ -3520,7 +2448,7 @@ function _loadGapi(auth) {
|
|
|
3520
2448
|
* See the License for the specific language governing permissions and
|
|
3521
2449
|
* limitations under the License.
|
|
3522
2450
|
*/
|
|
3523
|
-
var PING_TIMEOUT = new
|
|
2451
|
+
var PING_TIMEOUT = new phone.Delay(5000, 15000);
|
|
3524
2452
|
var IFRAME_PATH = '__/auth/iframe';
|
|
3525
2453
|
var EMULATED_IFRAME_PATH = 'emulator/auth/iframe';
|
|
3526
2454
|
var IFRAME_ATTRIBUTES = {
|
|
@@ -3541,9 +2469,9 @@ var EID_FROM_APIHOST = new Map([
|
|
|
3541
2469
|
]);
|
|
3542
2470
|
function getIframeUrl(auth) {
|
|
3543
2471
|
var config = auth.config;
|
|
3544
|
-
|
|
2472
|
+
phone._assert(config.authDomain, auth, "auth-domain-config-required" /* MISSING_AUTH_DOMAIN */);
|
|
3545
2473
|
var url = config.emulator
|
|
3546
|
-
?
|
|
2474
|
+
? phone._emulatorUrl(config, EMULATED_IFRAME_PATH)
|
|
3547
2475
|
: "https://" + auth.config.authDomain + "/" + IFRAME_PATH;
|
|
3548
2476
|
var params = {
|
|
3549
2477
|
apiKey: config.apiKey,
|
|
@@ -3569,8 +2497,8 @@ function _openIframe(auth) {
|
|
|
3569
2497
|
case 0: return [4 /*yield*/, _loadGapi(auth)];
|
|
3570
2498
|
case 1:
|
|
3571
2499
|
context = _a.sent();
|
|
3572
|
-
gapi = _window().gapi;
|
|
3573
|
-
|
|
2500
|
+
gapi = phone._window().gapi;
|
|
2501
|
+
phone._assert(gapi, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
3574
2502
|
return [2 /*return*/, context.open({
|
|
3575
2503
|
where: document.body,
|
|
3576
2504
|
url: getIframeUrl(auth),
|
|
@@ -3581,7 +2509,7 @@ function _openIframe(auth) {
|
|
|
3581
2509
|
return new Promise(function (resolve, reject) { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
3582
2510
|
// Clear timer and resolve pending iframe ready promise.
|
|
3583
2511
|
function clearTimerAndResolve() {
|
|
3584
|
-
_window().clearTimeout(networkErrorTimer);
|
|
2512
|
+
phone._window().clearTimeout(networkErrorTimer);
|
|
3585
2513
|
resolve(iframe);
|
|
3586
2514
|
}
|
|
3587
2515
|
var networkError, networkErrorTimer;
|
|
@@ -3593,8 +2521,8 @@ function _openIframe(auth) {
|
|
|
3593
2521
|
})];
|
|
3594
2522
|
case 1:
|
|
3595
2523
|
_a.sent();
|
|
3596
|
-
networkError =
|
|
3597
|
-
networkErrorTimer = _window().setTimeout(function () {
|
|
2524
|
+
networkError = phone._createError(auth, "network-request-failed" /* NETWORK_REQUEST_FAILED */);
|
|
2525
|
+
networkErrorTimer = phone._window().setTimeout(function () {
|
|
3598
2526
|
reject(networkError);
|
|
3599
2527
|
}, PING_TIMEOUT.get());
|
|
3600
2528
|
// This returns an IThenable. However the reject part does not call
|
|
@@ -3665,9 +2593,9 @@ function _open(auth, url, name, width, height) {
|
|
|
3665
2593
|
// specified, even though the popup is not necessarily blocked.
|
|
3666
2594
|
var ua = util.getUA().toLowerCase();
|
|
3667
2595
|
if (name) {
|
|
3668
|
-
target =
|
|
2596
|
+
target = phone._isChromeIOS(ua) ? TARGET_BLANK : name;
|
|
3669
2597
|
}
|
|
3670
|
-
if (
|
|
2598
|
+
if (phone._isFirefox(ua)) {
|
|
3671
2599
|
// Firefox complains when invalid URLs are popped out. Hacky way to bypass.
|
|
3672
2600
|
url = url || FIREFOX_EMPTY_URL;
|
|
3673
2601
|
// Firefox disables by default scrolling on popup windows, which can create
|
|
@@ -3678,14 +2606,14 @@ function _open(auth, url, name, width, height) {
|
|
|
3678
2606
|
var key = _a[0], value = _a[1];
|
|
3679
2607
|
return "" + accum + key + "=" + value + ",";
|
|
3680
2608
|
}, '');
|
|
3681
|
-
if (
|
|
2609
|
+
if (phone._isIOSStandalone(ua) && target !== '_self') {
|
|
3682
2610
|
openAsNewWindowIOS(url || '', target);
|
|
3683
2611
|
return new AuthPopup(null);
|
|
3684
2612
|
}
|
|
3685
2613
|
// about:blank getting sanitized causing browsers like IE/Edge to display
|
|
3686
2614
|
// brief error message before redirecting to handler.
|
|
3687
2615
|
var newWin = window.open(url || '', target, optionsString);
|
|
3688
|
-
|
|
2616
|
+
phone._assert(newWin, auth, "popup-blocked" /* POPUP_BLOCKED */);
|
|
3689
2617
|
// Flaky on IE edge, encapsulate with a try and catch.
|
|
3690
2618
|
try {
|
|
3691
2619
|
newWin.focus();
|
|
@@ -3731,8 +2659,8 @@ var WIDGET_PATH = '__/auth/handler';
|
|
|
3731
2659
|
*/
|
|
3732
2660
|
var EMULATOR_WIDGET_PATH = 'emulator/auth/handler';
|
|
3733
2661
|
function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additionalParams) {
|
|
3734
|
-
|
|
3735
|
-
|
|
2662
|
+
phone._assert(auth.config.authDomain, auth, "auth-domain-config-required" /* MISSING_AUTH_DOMAIN */);
|
|
2663
|
+
phone._assert(auth.config.apiKey, auth, "invalid-api-key" /* INVALID_API_KEY */);
|
|
3736
2664
|
var params = {
|
|
3737
2665
|
apiKey: auth.config.apiKey,
|
|
3738
2666
|
appName: auth.name,
|
|
@@ -3741,7 +2669,7 @@ function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additio
|
|
|
3741
2669
|
v: app.SDK_VERSION,
|
|
3742
2670
|
eventId: eventId
|
|
3743
2671
|
};
|
|
3744
|
-
if (provider instanceof
|
|
2672
|
+
if (provider instanceof phone.FederatedAuthProvider) {
|
|
3745
2673
|
provider.setDefaultLanguage(auth.languageCode);
|
|
3746
2674
|
params.providerId = provider.providerId || '';
|
|
3747
2675
|
if (!util.isEmpty(provider.getCustomParameters())) {
|
|
@@ -3753,7 +2681,7 @@ function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additio
|
|
|
3753
2681
|
params[key] = value;
|
|
3754
2682
|
}
|
|
3755
2683
|
}
|
|
3756
|
-
if (provider instanceof
|
|
2684
|
+
if (provider instanceof phone.BaseOAuthProvider) {
|
|
3757
2685
|
var scopes = provider.getScopes().filter(function (scope) { return scope !== ''; });
|
|
3758
2686
|
if (scopes.length > 0) {
|
|
3759
2687
|
params.scopes = scopes.join(',');
|
|
@@ -3778,7 +2706,7 @@ function getHandlerBase(_a) {
|
|
|
3778
2706
|
if (!config.emulator) {
|
|
3779
2707
|
return "https://" + config.authDomain + "/" + WIDGET_PATH;
|
|
3780
2708
|
}
|
|
3781
|
-
return
|
|
2709
|
+
return phone._emulatorUrl(config, EMULATOR_WIDGET_PATH);
|
|
3782
2710
|
}
|
|
3783
2711
|
|
|
3784
2712
|
/**
|
|
@@ -3817,8 +2745,8 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
3817
2745
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
3818
2746
|
var url;
|
|
3819
2747
|
return tslib.__generator(this, function (_b) {
|
|
3820
|
-
|
|
3821
|
-
url = _getRedirectUrl(auth, provider, authType,
|
|
2748
|
+
phone.debugAssert((_a = this.eventManagers[auth._key()]) === null || _a === void 0 ? void 0 : _a.manager, '_initialize() not called before _openPopup()');
|
|
2749
|
+
url = _getRedirectUrl(auth, provider, authType, phone._getCurrentUrl(), eventId);
|
|
3822
2750
|
return [2 /*return*/, _open(auth, url, _generateEventId())];
|
|
3823
2751
|
});
|
|
3824
2752
|
});
|
|
@@ -3830,7 +2758,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
3830
2758
|
case 0: return [4 /*yield*/, this._originValidation(auth)];
|
|
3831
2759
|
case 1:
|
|
3832
2760
|
_a.sent();
|
|
3833
|
-
_setWindowLocation(_getRedirectUrl(auth, provider, authType,
|
|
2761
|
+
phone._setWindowLocation(_getRedirectUrl(auth, provider, authType, phone._getCurrentUrl(), eventId));
|
|
3834
2762
|
return [2 /*return*/, new Promise(function () { })];
|
|
3835
2763
|
}
|
|
3836
2764
|
});
|
|
@@ -3844,7 +2772,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
3844
2772
|
return Promise.resolve(manager);
|
|
3845
2773
|
}
|
|
3846
2774
|
else {
|
|
3847
|
-
|
|
2775
|
+
phone.debugAssert(promise_1, 'If manager is not set, promise should be');
|
|
3848
2776
|
return promise_1;
|
|
3849
2777
|
}
|
|
3850
2778
|
}
|
|
@@ -3862,7 +2790,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
3862
2790
|
iframe = _a.sent();
|
|
3863
2791
|
manager = new AuthEventManager(auth);
|
|
3864
2792
|
iframe.register('authEvent', function (iframeEvent) {
|
|
3865
|
-
|
|
2793
|
+
phone._assert(iframeEvent === null || iframeEvent === void 0 ? void 0 : iframeEvent.authEvent, auth, "invalid-auth-event" /* INVALID_AUTH_EVENT */);
|
|
3866
2794
|
// TODO: Consider splitting redirect and popup events earlier on
|
|
3867
2795
|
var handled = manager.onEvent(iframeEvent.authEvent);
|
|
3868
2796
|
return { status: handled ? "ACK" /* ACK */ : "ERROR" /* ERROR */ };
|
|
@@ -3882,7 +2810,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
3882
2810
|
if (isSupported !== undefined) {
|
|
3883
2811
|
cb(!!isSupported);
|
|
3884
2812
|
}
|
|
3885
|
-
|
|
2813
|
+
phone._fail(auth, "internal-error" /* INTERNAL_ERROR */);
|
|
3886
2814
|
}, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);
|
|
3887
2815
|
};
|
|
3888
2816
|
BrowserPopupRedirectResolver.prototype._originValidation = function (auth) {
|
|
@@ -3895,7 +2823,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
3895
2823
|
Object.defineProperty(BrowserPopupRedirectResolver.prototype, "_shouldInitProactively", {
|
|
3896
2824
|
get: function () {
|
|
3897
2825
|
// Mobile browsers and Safari need to optimistically initialize
|
|
3898
|
-
return
|
|
2826
|
+
return phone._isMobileBrowser() || phone._isSafari() || phone._isIOS();
|
|
3899
2827
|
},
|
|
3900
2828
|
enumerable: false,
|
|
3901
2829
|
configurable: true
|
|
@@ -3910,81 +2838,6 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
3910
2838
|
*/
|
|
3911
2839
|
var browserPopupRedirectResolver = BrowserPopupRedirectResolver;
|
|
3912
2840
|
|
|
3913
|
-
var MultiFactorAssertionImpl = /** @class */ (function () {
|
|
3914
|
-
function MultiFactorAssertionImpl(factorId) {
|
|
3915
|
-
this.factorId = factorId;
|
|
3916
|
-
}
|
|
3917
|
-
MultiFactorAssertionImpl.prototype._process = function (auth, session, displayName) {
|
|
3918
|
-
switch (session.type) {
|
|
3919
|
-
case "enroll" /* ENROLL */:
|
|
3920
|
-
return this._finalizeEnroll(auth, session.credential, displayName);
|
|
3921
|
-
case "signin" /* SIGN_IN */:
|
|
3922
|
-
return this._finalizeSignIn(auth, session.credential);
|
|
3923
|
-
default:
|
|
3924
|
-
return enum_maps.debugFail('unexpected MultiFactorSessionType');
|
|
3925
|
-
}
|
|
3926
|
-
};
|
|
3927
|
-
return MultiFactorAssertionImpl;
|
|
3928
|
-
}());
|
|
3929
|
-
|
|
3930
|
-
/**
|
|
3931
|
-
* {@inheritdoc PhoneMultiFactorAssertion}
|
|
3932
|
-
*
|
|
3933
|
-
* @public
|
|
3934
|
-
*/
|
|
3935
|
-
var PhoneMultiFactorAssertionImpl = /** @class */ (function (_super) {
|
|
3936
|
-
tslib.__extends(PhoneMultiFactorAssertionImpl, _super);
|
|
3937
|
-
function PhoneMultiFactorAssertionImpl(credential) {
|
|
3938
|
-
var _this = _super.call(this, "phone" /* PHONE */) || this;
|
|
3939
|
-
_this.credential = credential;
|
|
3940
|
-
return _this;
|
|
3941
|
-
}
|
|
3942
|
-
/** @internal */
|
|
3943
|
-
PhoneMultiFactorAssertionImpl._fromCredential = function (credential) {
|
|
3944
|
-
return new PhoneMultiFactorAssertionImpl(credential);
|
|
3945
|
-
};
|
|
3946
|
-
/** @internal */
|
|
3947
|
-
PhoneMultiFactorAssertionImpl.prototype._finalizeEnroll = function (auth, idToken, displayName) {
|
|
3948
|
-
return enum_maps.finalizeEnrollPhoneMfa(auth, {
|
|
3949
|
-
idToken: idToken,
|
|
3950
|
-
displayName: displayName,
|
|
3951
|
-
phoneVerificationInfo: this.credential._makeVerificationRequest()
|
|
3952
|
-
});
|
|
3953
|
-
};
|
|
3954
|
-
/** @internal */
|
|
3955
|
-
PhoneMultiFactorAssertionImpl.prototype._finalizeSignIn = function (auth, mfaPendingCredential) {
|
|
3956
|
-
return finalizeSignInPhoneMfa(auth, {
|
|
3957
|
-
mfaPendingCredential: mfaPendingCredential,
|
|
3958
|
-
phoneVerificationInfo: this.credential._makeVerificationRequest()
|
|
3959
|
-
});
|
|
3960
|
-
};
|
|
3961
|
-
return PhoneMultiFactorAssertionImpl;
|
|
3962
|
-
}(MultiFactorAssertionImpl));
|
|
3963
|
-
/**
|
|
3964
|
-
* Provider for generating a {@link PhoneMultiFactorAssertion}.
|
|
3965
|
-
*
|
|
3966
|
-
* @public
|
|
3967
|
-
*/
|
|
3968
|
-
var PhoneMultiFactorGenerator = /** @class */ (function () {
|
|
3969
|
-
function PhoneMultiFactorGenerator() {
|
|
3970
|
-
}
|
|
3971
|
-
/**
|
|
3972
|
-
* Provides a {@link PhoneMultiFactorAssertion} to confirm ownership of the phone second factor.
|
|
3973
|
-
*
|
|
3974
|
-
* @param phoneAuthCredential - A credential provided by {@link PhoneAuthProvider.credential}.
|
|
3975
|
-
* @returns A {@link PhoneMultiFactorAssertion} which can be used with
|
|
3976
|
-
* {@link MultiFactorResolver.resolveSignIn}
|
|
3977
|
-
*/
|
|
3978
|
-
PhoneMultiFactorGenerator.assertion = function (credential) {
|
|
3979
|
-
return PhoneMultiFactorAssertionImpl._fromCredential(credential);
|
|
3980
|
-
};
|
|
3981
|
-
/**
|
|
3982
|
-
* The identifier of the phone second factor: `phone`.
|
|
3983
|
-
*/
|
|
3984
|
-
PhoneMultiFactorGenerator.FACTOR_ID = 'phone';
|
|
3985
|
-
return PhoneMultiFactorGenerator;
|
|
3986
|
-
}());
|
|
3987
|
-
|
|
3988
2841
|
/**
|
|
3989
2842
|
* @license
|
|
3990
2843
|
* Copyright 2021 Google LLC
|
|
@@ -4015,7 +2868,7 @@ function getAuth(app$1) {
|
|
|
4015
2868
|
if (provider.isInitialized()) {
|
|
4016
2869
|
return provider.getImmediate();
|
|
4017
2870
|
}
|
|
4018
|
-
return
|
|
2871
|
+
return phone.initializeAuth(app$1, {
|
|
4019
2872
|
popupRedirectResolver: browserPopupRedirectResolver,
|
|
4020
2873
|
persistence: [
|
|
4021
2874
|
indexedDBLocalPersistence,
|
|
@@ -4024,7 +2877,7 @@ function getAuth(app$1) {
|
|
|
4024
2877
|
]
|
|
4025
2878
|
});
|
|
4026
2879
|
}
|
|
4027
|
-
|
|
2880
|
+
phone.registerAuth("Browser" /* BROWSER */);
|
|
4028
2881
|
|
|
4029
2882
|
/**
|
|
4030
2883
|
* @license
|
|
@@ -4078,21 +2931,21 @@ function _generateHandlerUrl(auth, event, provider) {
|
|
|
4078
2931
|
switch (_b.label) {
|
|
4079
2932
|
case 0:
|
|
4080
2933
|
BuildInfo = _cordovaWindow().BuildInfo;
|
|
4081
|
-
|
|
2934
|
+
phone.debugAssert(event.sessionId, 'AuthEvent did not contain a session ID');
|
|
4082
2935
|
return [4 /*yield*/, computeSha256(event.sessionId)];
|
|
4083
2936
|
case 1:
|
|
4084
2937
|
sessionDigest = _b.sent();
|
|
4085
2938
|
additionalParams = {};
|
|
4086
|
-
if (
|
|
2939
|
+
if (phone._isIOS()) {
|
|
4087
2940
|
// iOS app identifier
|
|
4088
2941
|
additionalParams['ibi'] = BuildInfo.packageName;
|
|
4089
2942
|
}
|
|
4090
|
-
else if (
|
|
2943
|
+
else if (phone._isAndroid()) {
|
|
4091
2944
|
// Android app identifier
|
|
4092
2945
|
additionalParams['apn'] = BuildInfo.packageName;
|
|
4093
2946
|
}
|
|
4094
2947
|
else {
|
|
4095
|
-
|
|
2948
|
+
phone._fail(auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
4096
2949
|
}
|
|
4097
2950
|
// Add the display name if available
|
|
4098
2951
|
if (BuildInfo.displayName) {
|
|
@@ -4116,14 +2969,14 @@ function _validateOrigin(auth) {
|
|
|
4116
2969
|
case 0:
|
|
4117
2970
|
BuildInfo = _cordovaWindow().BuildInfo;
|
|
4118
2971
|
request = {};
|
|
4119
|
-
if (
|
|
2972
|
+
if (phone._isIOS()) {
|
|
4120
2973
|
request.iosBundleId = BuildInfo.packageName;
|
|
4121
2974
|
}
|
|
4122
|
-
else if (
|
|
2975
|
+
else if (phone._isAndroid()) {
|
|
4123
2976
|
request.androidPackageName = BuildInfo.packageName;
|
|
4124
2977
|
}
|
|
4125
2978
|
else {
|
|
4126
|
-
|
|
2979
|
+
phone._fail(auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
4127
2980
|
}
|
|
4128
2981
|
// Will fail automatically if package name is not authorized
|
|
4129
2982
|
return [4 /*yield*/, _getProjectConfig(auth, request)];
|
|
@@ -4146,7 +2999,7 @@ function _performRedirect(handlerUrl) {
|
|
|
4146
2999
|
}
|
|
4147
3000
|
else {
|
|
4148
3001
|
// TODO: Return the inappbrowser ref that's returned from the open call
|
|
4149
|
-
iabRef = cordova.InAppBrowser.open(handlerUrl,
|
|
3002
|
+
iabRef = cordova.InAppBrowser.open(handlerUrl, phone._isIOS7Or8() ? '_blank' : '_system', 'location=yes');
|
|
4150
3003
|
}
|
|
4151
3004
|
resolve(iabRef);
|
|
4152
3005
|
});
|
|
@@ -4194,7 +3047,7 @@ function _waitForAppResume(auth, eventListener, iabRef) {
|
|
|
4194
3047
|
}
|
|
4195
3048
|
onCloseTimer = window.setTimeout(function () {
|
|
4196
3049
|
// Wait two seeconds after resume then reject.
|
|
4197
|
-
reject(
|
|
3050
|
+
reject(phone._createError(auth, "redirect-cancelled-by-user" /* REDIRECT_CANCELLED_BY_USER */));
|
|
4198
3051
|
}, REDIRECT_TIMEOUT_MS);
|
|
4199
3052
|
}
|
|
4200
3053
|
function visibilityChanged() {
|
|
@@ -4207,7 +3060,7 @@ function _waitForAppResume(auth, eventListener, iabRef) {
|
|
|
4207
3060
|
eventListener.addPassiveListener(authEventSeen);
|
|
4208
3061
|
// Listen for resume and visibility events
|
|
4209
3062
|
document.addEventListener('resume', resumed, false);
|
|
4210
|
-
if (
|
|
3063
|
+
if (phone._isAndroid()) {
|
|
4211
3064
|
document.addEventListener('visibilitychange', visibilityChanged, false);
|
|
4212
3065
|
}
|
|
4213
3066
|
// SETUP THE CLEANUP FUNCTION =====
|
|
@@ -4244,22 +3097,22 @@ function _checkCordovaConfiguration(auth) {
|
|
|
4244
3097
|
// Note that cordova-universal-links-plugin has been abandoned.
|
|
4245
3098
|
// A fork with latest fixes is available at:
|
|
4246
3099
|
// https://www.npmjs.com/package/cordova-universal-links-plugin-fix
|
|
4247
|
-
|
|
3100
|
+
phone._assert(typeof ((_a = win === null || win === void 0 ? void 0 : win.universalLinks) === null || _a === void 0 ? void 0 : _a.subscribe) === 'function', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
4248
3101
|
missingPlugin: 'cordova-universal-links-plugin-fix'
|
|
4249
3102
|
});
|
|
4250
3103
|
// https://www.npmjs.com/package/cordova-plugin-buildinfo
|
|
4251
|
-
|
|
3104
|
+
phone._assert(typeof ((_b = win === null || win === void 0 ? void 0 : win.BuildInfo) === null || _b === void 0 ? void 0 : _b.packageName) !== 'undefined', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
4252
3105
|
missingPlugin: 'cordova-plugin-buildInfo'
|
|
4253
3106
|
});
|
|
4254
3107
|
// https://github.com/google/cordova-plugin-browsertab
|
|
4255
|
-
|
|
3108
|
+
phone._assert(typeof ((_e = (_d = (_c = win === null || win === void 0 ? void 0 : win.cordova) === null || _c === void 0 ? void 0 : _c.plugins) === null || _d === void 0 ? void 0 : _d.browsertab) === null || _e === void 0 ? void 0 : _e.openUrl) === 'function', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
4256
3109
|
missingPlugin: 'cordova-plugin-browsertab'
|
|
4257
3110
|
});
|
|
4258
|
-
|
|
3111
|
+
phone._assert(typeof ((_h = (_g = (_f = win === null || win === void 0 ? void 0 : win.cordova) === null || _f === void 0 ? void 0 : _f.plugins) === null || _g === void 0 ? void 0 : _g.browsertab) === null || _h === void 0 ? void 0 : _h.isAvailable) === 'function', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
4259
3112
|
missingPlugin: 'cordova-plugin-browsertab'
|
|
4260
3113
|
});
|
|
4261
3114
|
// https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/
|
|
4262
|
-
|
|
3115
|
+
phone._assert(typeof ((_k = (_j = win === null || win === void 0 ? void 0 : win.cordova) === null || _j === void 0 ? void 0 : _j.InAppBrowser) === null || _k === void 0 ? void 0 : _k.open) === 'function', auth, "invalid-cordova-configuration" /* INVALID_CORDOVA_CONFIGURATION */, {
|
|
4263
3116
|
missingPlugin: 'cordova-plugin-inappbrowser'
|
|
4264
3117
|
});
|
|
4265
3118
|
}
|
|
@@ -4287,7 +3140,7 @@ function computeSha256(sessionId) {
|
|
|
4287
3140
|
function stringToArrayBuffer(str) {
|
|
4288
3141
|
// This function is only meant to deal with an ASCII charset and makes
|
|
4289
3142
|
// certain simplifying assumptions.
|
|
4290
|
-
|
|
3143
|
+
phone.debugAssert(/[0-9a-zA-Z]+/.test(str), 'Can only convert alpha-numeric strings');
|
|
4291
3144
|
if (typeof TextEncoder !== 'undefined') {
|
|
4292
3145
|
return new TextEncoder().encode(str);
|
|
4293
3146
|
}
|
|
@@ -4371,7 +3224,7 @@ function _generateNewEvent(auth, type, eventId) {
|
|
|
4371
3224
|
sessionId: generateSessionId(),
|
|
4372
3225
|
postBody: null,
|
|
4373
3226
|
tenantId: auth.tenantId,
|
|
4374
|
-
error:
|
|
3227
|
+
error: phone._createError(auth, "no-auth-event" /* NO_AUTH_EVENT */)
|
|
4375
3228
|
};
|
|
4376
3229
|
}
|
|
4377
3230
|
function _savePartialEvent(auth, event) {
|
|
@@ -4414,7 +3267,7 @@ function _eventFromPartialAndUrl(partialEvent, url) {
|
|
|
4414
3267
|
? parseJsonOrNull(decodeURIComponent(params['firebaseError']))
|
|
4415
3268
|
: null;
|
|
4416
3269
|
var code = (_b = (_a = errorObject === null || errorObject === void 0 ? void 0 : errorObject['code']) === null || _a === void 0 ? void 0 : _a.split('auth/')) === null || _b === void 0 ? void 0 : _b[1];
|
|
4417
|
-
var error = code ?
|
|
3270
|
+
var error = code ? phone._createError(code) : null;
|
|
4418
3271
|
if (error) {
|
|
4419
3272
|
return {
|
|
4420
3273
|
type: partialEvent.type,
|
|
@@ -4449,10 +3302,10 @@ function generateSessionId() {
|
|
|
4449
3302
|
return chars.join('');
|
|
4450
3303
|
}
|
|
4451
3304
|
function storage() {
|
|
4452
|
-
return
|
|
3305
|
+
return phone._getInstance(browserLocalPersistence);
|
|
4453
3306
|
}
|
|
4454
3307
|
function persistenceKey(auth) {
|
|
4455
|
-
return
|
|
3308
|
+
return phone._persistenceKeyName("authEvent" /* AUTH_EVENT */, auth.config.apiKey, auth.name);
|
|
4456
3309
|
}
|
|
4457
3310
|
function parseJsonOrNull(json) {
|
|
4458
3311
|
try {
|
|
@@ -4532,7 +3385,7 @@ var CordovaPopupRedirectResolver = /** @class */ (function () {
|
|
|
4532
3385
|
});
|
|
4533
3386
|
};
|
|
4534
3387
|
CordovaPopupRedirectResolver.prototype._openPopup = function (auth) {
|
|
4535
|
-
|
|
3388
|
+
phone._fail(auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
|
|
4536
3389
|
};
|
|
4537
3390
|
CordovaPopupRedirectResolver.prototype._openRedirect = function (auth, provider, authType, eventId) {
|
|
4538
3391
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
@@ -4670,7 +3523,7 @@ function generateNoEvent() {
|
|
|
4670
3523
|
urlResponse: null,
|
|
4671
3524
|
postBody: null,
|
|
4672
3525
|
tenantId: null,
|
|
4673
|
-
error:
|
|
3526
|
+
error: phone._createError("no-auth-event" /* NO_AUTH_EVENT */)
|
|
4674
3527
|
};
|
|
4675
3528
|
}
|
|
4676
3529
|
|
|
@@ -4694,82 +3547,86 @@ function generateNoEvent() {
|
|
|
4694
3547
|
// It is not intended for direct use by developer apps. NO jsdoc here to intentionally leave it out
|
|
4695
3548
|
// of autogenerated documentation pages to reduce accidental misuse.
|
|
4696
3549
|
function addFrameworkForLogging(auth, framework) {
|
|
4697
|
-
|
|
3550
|
+
phone._castAuth(auth)._logFramework(framework);
|
|
4698
3551
|
}
|
|
4699
3552
|
|
|
4700
|
-
exports.ActionCodeOperation =
|
|
4701
|
-
exports.ActionCodeURL =
|
|
4702
|
-
exports.AuthCredential =
|
|
4703
|
-
exports.AuthErrorCodes =
|
|
4704
|
-
exports.AuthImpl =
|
|
4705
|
-
exports.EmailAuthCredential =
|
|
4706
|
-
exports.EmailAuthProvider =
|
|
4707
|
-
exports.FacebookAuthProvider =
|
|
4708
|
-
exports.FactorId =
|
|
4709
|
-
exports.FetchProvider =
|
|
4710
|
-
exports.GithubAuthProvider =
|
|
4711
|
-
exports.GoogleAuthProvider =
|
|
4712
|
-
exports.OAuthCredential =
|
|
4713
|
-
exports.OAuthProvider =
|
|
4714
|
-
exports.OperationType =
|
|
4715
|
-
exports.PhoneAuthCredential =
|
|
4716
|
-
exports.
|
|
4717
|
-
exports.
|
|
4718
|
-
exports.
|
|
4719
|
-
exports.
|
|
4720
|
-
exports.
|
|
4721
|
-
exports.
|
|
4722
|
-
exports.
|
|
4723
|
-
exports.
|
|
4724
|
-
exports.
|
|
4725
|
-
exports.
|
|
4726
|
-
exports.
|
|
4727
|
-
exports.
|
|
4728
|
-
exports.
|
|
4729
|
-
exports.
|
|
4730
|
-
exports.
|
|
4731
|
-
exports.
|
|
4732
|
-
exports.
|
|
4733
|
-
exports.
|
|
4734
|
-
exports.
|
|
4735
|
-
exports.
|
|
4736
|
-
exports.
|
|
4737
|
-
exports.
|
|
4738
|
-
exports.
|
|
4739
|
-
exports.
|
|
4740
|
-
exports.
|
|
4741
|
-
exports.
|
|
4742
|
-
exports.
|
|
4743
|
-
exports.
|
|
4744
|
-
exports.
|
|
4745
|
-
exports.
|
|
4746
|
-
exports.
|
|
4747
|
-
exports.
|
|
4748
|
-
exports.
|
|
4749
|
-
exports.
|
|
4750
|
-
exports.
|
|
4751
|
-
exports.
|
|
4752
|
-
exports.
|
|
4753
|
-
exports.
|
|
4754
|
-
exports.
|
|
4755
|
-
exports.
|
|
4756
|
-
exports.
|
|
4757
|
-
exports.
|
|
4758
|
-
exports.
|
|
4759
|
-
exports.
|
|
4760
|
-
exports.
|
|
4761
|
-
exports.
|
|
4762
|
-
exports.
|
|
4763
|
-
exports.
|
|
4764
|
-
exports.
|
|
4765
|
-
exports.
|
|
4766
|
-
exports.
|
|
4767
|
-
exports.
|
|
4768
|
-
exports.
|
|
3553
|
+
exports.ActionCodeOperation = phone.ActionCodeOperation;
|
|
3554
|
+
exports.ActionCodeURL = phone.ActionCodeURL;
|
|
3555
|
+
exports.AuthCredential = phone.AuthCredential;
|
|
3556
|
+
exports.AuthErrorCodes = phone.AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY;
|
|
3557
|
+
exports.AuthImpl = phone.AuthImpl;
|
|
3558
|
+
exports.EmailAuthCredential = phone.EmailAuthCredential;
|
|
3559
|
+
exports.EmailAuthProvider = phone.EmailAuthProvider;
|
|
3560
|
+
exports.FacebookAuthProvider = phone.FacebookAuthProvider;
|
|
3561
|
+
exports.FactorId = phone.FactorId;
|
|
3562
|
+
exports.FetchProvider = phone.FetchProvider;
|
|
3563
|
+
exports.GithubAuthProvider = phone.GithubAuthProvider;
|
|
3564
|
+
exports.GoogleAuthProvider = phone.GoogleAuthProvider;
|
|
3565
|
+
exports.OAuthCredential = phone.OAuthCredential;
|
|
3566
|
+
exports.OAuthProvider = phone.OAuthProvider;
|
|
3567
|
+
exports.OperationType = phone.OperationType;
|
|
3568
|
+
exports.PhoneAuthCredential = phone.PhoneAuthCredential;
|
|
3569
|
+
exports.PhoneAuthProvider = phone.PhoneAuthProvider;
|
|
3570
|
+
exports.PhoneMultiFactorGenerator = phone.PhoneMultiFactorGenerator;
|
|
3571
|
+
exports.ProviderId = phone.ProviderId;
|
|
3572
|
+
exports.RecaptchaVerifier = phone.RecaptchaVerifier;
|
|
3573
|
+
exports.SAMLAuthCredential = phone.SAMLAuthCredential;
|
|
3574
|
+
exports.SAMLAuthProvider = phone.SAMLAuthProvider;
|
|
3575
|
+
exports.SignInMethod = phone.SignInMethod;
|
|
3576
|
+
exports.TwitterAuthProvider = phone.TwitterAuthProvider;
|
|
3577
|
+
exports.UserImpl = phone.UserImpl;
|
|
3578
|
+
exports._assert = phone._assert;
|
|
3579
|
+
exports._castAuth = phone._castAuth;
|
|
3580
|
+
exports._fail = phone._fail;
|
|
3581
|
+
exports._getClientVersion = phone._getClientVersion;
|
|
3582
|
+
exports._getInstance = phone._getInstance;
|
|
3583
|
+
exports._persistenceKeyName = phone._persistenceKeyName;
|
|
3584
|
+
exports.applyActionCode = phone.applyActionCode;
|
|
3585
|
+
exports.checkActionCode = phone.checkActionCode;
|
|
3586
|
+
exports.confirmPasswordReset = phone.confirmPasswordReset;
|
|
3587
|
+
exports.connectAuthEmulator = phone.connectAuthEmulator;
|
|
3588
|
+
exports.createUserWithEmailAndPassword = phone.createUserWithEmailAndPassword;
|
|
3589
|
+
exports.debugErrorMap = phone.debugErrorMap;
|
|
3590
|
+
exports.deleteUser = phone.deleteUser;
|
|
3591
|
+
exports.fetchSignInMethodsForEmail = phone.fetchSignInMethodsForEmail;
|
|
3592
|
+
exports.getAdditionalUserInfo = phone.getAdditionalUserInfo;
|
|
3593
|
+
exports.getIdToken = phone.getIdToken;
|
|
3594
|
+
exports.getIdTokenResult = phone.getIdTokenResult;
|
|
3595
|
+
exports.getMultiFactorResolver = phone.getMultiFactorResolver;
|
|
3596
|
+
exports.inMemoryPersistence = phone.inMemoryPersistence;
|
|
3597
|
+
exports.initializeAuth = phone.initializeAuth;
|
|
3598
|
+
exports.isSignInWithEmailLink = phone.isSignInWithEmailLink;
|
|
3599
|
+
exports.linkWithCredential = phone.linkWithCredential;
|
|
3600
|
+
exports.linkWithPhoneNumber = phone.linkWithPhoneNumber;
|
|
3601
|
+
exports.multiFactor = phone.multiFactor;
|
|
3602
|
+
exports.onAuthStateChanged = phone.onAuthStateChanged;
|
|
3603
|
+
exports.onIdTokenChanged = phone.onIdTokenChanged;
|
|
3604
|
+
exports.parseActionCodeURL = phone.parseActionCodeURL;
|
|
3605
|
+
exports.prodErrorMap = phone.prodErrorMap;
|
|
3606
|
+
exports.reauthenticateWithCredential = phone.reauthenticateWithCredential;
|
|
3607
|
+
exports.reauthenticateWithPhoneNumber = phone.reauthenticateWithPhoneNumber;
|
|
3608
|
+
exports.reload = phone.reload;
|
|
3609
|
+
exports.sendEmailVerification = phone.sendEmailVerification;
|
|
3610
|
+
exports.sendPasswordResetEmail = phone.sendPasswordResetEmail;
|
|
3611
|
+
exports.sendSignInLinkToEmail = phone.sendSignInLinkToEmail;
|
|
3612
|
+
exports.setPersistence = phone.setPersistence;
|
|
3613
|
+
exports.signInAnonymously = phone.signInAnonymously;
|
|
3614
|
+
exports.signInWithCredential = phone.signInWithCredential;
|
|
3615
|
+
exports.signInWithCustomToken = phone.signInWithCustomToken;
|
|
3616
|
+
exports.signInWithEmailAndPassword = phone.signInWithEmailAndPassword;
|
|
3617
|
+
exports.signInWithEmailLink = phone.signInWithEmailLink;
|
|
3618
|
+
exports.signInWithPhoneNumber = phone.signInWithPhoneNumber;
|
|
3619
|
+
exports.signOut = phone.signOut;
|
|
3620
|
+
exports.unlink = phone.unlink;
|
|
3621
|
+
exports.updateCurrentUser = phone.updateCurrentUser;
|
|
3622
|
+
exports.updateEmail = phone.updateEmail;
|
|
3623
|
+
exports.updatePassword = phone.updatePassword;
|
|
3624
|
+
exports.updatePhoneNumber = phone.updatePhoneNumber;
|
|
3625
|
+
exports.updateProfile = phone.updateProfile;
|
|
3626
|
+
exports.useDeviceLanguage = phone.useDeviceLanguage;
|
|
3627
|
+
exports.verifyBeforeUpdateEmail = phone.verifyBeforeUpdateEmail;
|
|
3628
|
+
exports.verifyPasswordResetCode = phone.verifyPasswordResetCode;
|
|
4769
3629
|
exports.AuthPopup = AuthPopup;
|
|
4770
|
-
exports.PhoneAuthProvider = PhoneAuthProvider;
|
|
4771
|
-
exports.PhoneMultiFactorGenerator = PhoneMultiFactorGenerator;
|
|
4772
|
-
exports.RecaptchaVerifier = RecaptchaVerifier;
|
|
4773
3630
|
exports._generateEventId = _generateEventId;
|
|
4774
3631
|
exports._getRedirectResult = _getRedirectResult;
|
|
4775
3632
|
exports.addFrameworkForLogging = addFrameworkForLogging;
|
|
@@ -4780,14 +3637,10 @@ exports.cordovaPopupRedirectResolver = cordovaPopupRedirectResolver;
|
|
|
4780
3637
|
exports.getAuth = getAuth;
|
|
4781
3638
|
exports.getRedirectResult = getRedirectResult;
|
|
4782
3639
|
exports.indexedDBLocalPersistence = indexedDBLocalPersistence;
|
|
4783
|
-
exports.linkWithPhoneNumber = linkWithPhoneNumber;
|
|
4784
3640
|
exports.linkWithPopup = linkWithPopup;
|
|
4785
3641
|
exports.linkWithRedirect = linkWithRedirect;
|
|
4786
|
-
exports.reauthenticateWithPhoneNumber = reauthenticateWithPhoneNumber;
|
|
4787
3642
|
exports.reauthenticateWithPopup = reauthenticateWithPopup;
|
|
4788
3643
|
exports.reauthenticateWithRedirect = reauthenticateWithRedirect;
|
|
4789
|
-
exports.signInWithPhoneNumber = signInWithPhoneNumber;
|
|
4790
3644
|
exports.signInWithPopup = signInWithPopup;
|
|
4791
3645
|
exports.signInWithRedirect = signInWithRedirect;
|
|
4792
|
-
exports.updatePhoneNumber = updatePhoneNumber;
|
|
4793
3646
|
//# sourceMappingURL=internal.js.map
|