@firebase/auth 0.21.1 → 0.21.2-20230201003102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/auth-public.d.ts +8 -4
- package/dist/auth.d.ts +8 -4
- package/dist/browser-cjs/index-09687647.js +9642 -0
- package/dist/browser-cjs/index-09687647.js.map +1 -0
- package/dist/browser-cjs/index.cordova.d.ts +32 -0
- package/dist/browser-cjs/index.d.ts +36 -0
- package/dist/browser-cjs/index.doc.d.ts +24 -0
- package/dist/browser-cjs/index.js +93 -0
- package/dist/browser-cjs/index.js.map +1 -0
- package/dist/browser-cjs/index.node.d.ts +17 -0
- package/dist/browser-cjs/index.rn.d.ts +32 -0
- package/dist/browser-cjs/index.shared.d.ts +19 -0
- package/dist/browser-cjs/index.webworker.d.ts +21 -0
- package/dist/browser-cjs/internal/index.d.ts +42 -0
- package/dist/browser-cjs/internal.js +667 -0
- package/dist/browser-cjs/internal.js.map +1 -0
- package/dist/browser-cjs/scripts/run_node_tests.d.ts +17 -0
- package/dist/browser-cjs/src/api/account_management/account.d.ts +59 -0
- package/dist/browser-cjs/src/api/account_management/account.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/account_management/email_and_password.d.ts +47 -0
- package/dist/browser-cjs/src/api/account_management/email_and_password.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/account_management/mfa.d.ts +69 -0
- package/dist/browser-cjs/src/api/account_management/mfa.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/account_management/profile.d.ts +29 -0
- package/dist/browser-cjs/src/api/account_management/profile.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/create_auth_uri.d.ts +26 -0
- package/dist/browser-cjs/src/api/authentication/create_auth_uri.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/custom_token.d.ts +26 -0
- package/dist/browser-cjs/src/api/authentication/custom_token.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/email_and_password.d.ts +76 -0
- package/dist/browser-cjs/src/api/authentication/email_and_password.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/email_link.d.ts +32 -0
- package/dist/browser-cjs/src/api/authentication/email_link.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/idp.d.ts +40 -0
- package/dist/browser-cjs/src/api/authentication/idp.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/mfa.d.ts +58 -0
- package/dist/browser-cjs/src/api/authentication/mfa.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/recaptcha.d.ts +18 -0
- package/dist/browser-cjs/src/api/authentication/recaptcha.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/sign_up.d.ts +29 -0
- package/dist/browser-cjs/src/api/authentication/sign_up.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/sms.d.ts +50 -0
- package/dist/browser-cjs/src/api/authentication/sms.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/authentication/token.d.ts +26 -0
- package/dist/browser-cjs/src/api/authentication/token.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/errors.d.ts +118 -0
- package/dist/browser-cjs/src/api/index.d.ts +69 -0
- package/dist/browser-cjs/src/api/index.test.d.ts +17 -0
- package/dist/browser-cjs/src/api/project_config/get_project_config.d.ts +25 -0
- package/dist/browser-cjs/src/api/project_config/get_project_config.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/action_code_url.d.ts +73 -0
- package/dist/browser-cjs/src/core/action_code_url.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/auth/auth_event_manager.d.ts +34 -0
- package/dist/browser-cjs/src/core/auth/auth_event_manager.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/auth/auth_impl.d.ts +110 -0
- package/dist/browser-cjs/src/core/auth/auth_impl.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/auth/emulator.d.ts +42 -0
- package/dist/browser-cjs/src/core/auth/emulator.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/auth/firebase_internal.d.ts +35 -0
- package/dist/browser-cjs/src/core/auth/firebase_internal.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/auth/initialize.d.ts +46 -0
- package/dist/browser-cjs/src/core/auth/initialize.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/auth/middleware.d.ts +25 -0
- package/dist/browser-cjs/src/core/auth/middleware.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/auth/register.d.ts +23 -0
- package/dist/browser-cjs/src/core/credentials/auth_credential.d.ts +75 -0
- package/dist/browser-cjs/src/core/credentials/email.d.ts +60 -0
- package/dist/browser-cjs/src/core/credentials/email.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/credentials/index.d.ts +23 -0
- package/dist/browser-cjs/src/core/credentials/oauth.d.ts +81 -0
- package/dist/browser-cjs/src/core/credentials/oauth.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/credentials/phone.d.ts +52 -0
- package/dist/browser-cjs/src/core/credentials/phone.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/credentials/saml.d.ts +52 -0
- package/dist/browser-cjs/src/core/credentials/saml.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/errors.d.ts +305 -0
- package/dist/browser-cjs/src/core/errors.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/index.d.ts +158 -0
- package/dist/browser-cjs/src/core/persistence/in_memory.d.ts +35 -0
- package/dist/browser-cjs/src/core/persistence/in_memory.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/persistence/index.d.ts +41 -0
- package/dist/browser-cjs/src/core/persistence/persistence_user_manager.d.ts +45 -0
- package/dist/browser-cjs/src/core/persistence/persistence_user_manager.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/providers/email.d.ts +83 -0
- package/dist/browser-cjs/src/core/providers/email.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/providers/facebook.d.ts +93 -0
- package/dist/browser-cjs/src/core/providers/facebook.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/providers/federated.d.ts +64 -0
- package/dist/browser-cjs/src/core/providers/federated.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/providers/github.d.ts +89 -0
- package/dist/browser-cjs/src/core/providers/github.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/providers/google.d.ts +96 -0
- package/dist/browser-cjs/src/core/providers/google.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/providers/oauth.d.ts +151 -0
- package/dist/browser-cjs/src/core/providers/oauth.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/providers/saml.d.ts +62 -0
- package/dist/browser-cjs/src/core/providers/saml.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/providers/twitter.d.ts +103 -0
- package/dist/browser-cjs/src/core/providers/twitter.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/abstract_popup_redirect_operation.d.ts +44 -0
- package/dist/browser-cjs/src/core/strategies/abstract_popup_redirect_operation.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/action_code_settings.d.ts +19 -0
- package/dist/browser-cjs/src/core/strategies/action_code_settings.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/anonymous.d.ts +29 -0
- package/dist/browser-cjs/src/core/strategies/anonymous.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/credential.d.ts +58 -0
- package/dist/browser-cjs/src/core/strategies/credential.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/custom_token.d.ts +34 -0
- package/dist/browser-cjs/src/core/strategies/custom_token.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/email.d.ts +98 -0
- package/dist/browser-cjs/src/core/strategies/email.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/email_and_password.d.ts +126 -0
- package/dist/browser-cjs/src/core/strategies/email_and_password.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/email_link.d.ts +103 -0
- package/dist/browser-cjs/src/core/strategies/email_link.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/idp.d.ts +32 -0
- package/dist/browser-cjs/src/core/strategies/idp.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/strategies/redirect.d.ts +36 -0
- package/dist/browser-cjs/src/core/strategies/redirect.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/account_info.d.ts +60 -0
- package/dist/browser-cjs/src/core/user/account_info.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/additional_user_info.d.ts +31 -0
- package/dist/browser-cjs/src/core/user/additional_user_info.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/id_token_result.d.ts +48 -0
- package/dist/browser-cjs/src/core/user/id_token_result.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/invalidation.d.ts +18 -0
- package/dist/browser-cjs/src/core/user/invalidation.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/link_unlink.d.ts +30 -0
- package/dist/browser-cjs/src/core/user/link_unlink.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/proactive_refresh.d.ts +34 -0
- package/dist/browser-cjs/src/core/user/proactive_refresh.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/reauthenticate.d.ts +20 -0
- package/dist/browser-cjs/src/core/user/reauthenticate.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/reload.d.ts +27 -0
- package/dist/browser-cjs/src/core/user/reload.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/token_manager.d.ts +49 -0
- package/dist/browser-cjs/src/core/user/token_manager.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/user_credential_impl.d.ts +37 -0
- package/dist/browser-cjs/src/core/user/user_credential_impl.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/user_impl.d.ts +68 -0
- package/dist/browser-cjs/src/core/user/user_impl.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/user/user_metadata.d.ts +27 -0
- package/dist/browser-cjs/src/core/util/assert.d.ts +93 -0
- package/dist/browser-cjs/src/core/util/assert.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/browser.d.ts +50 -0
- package/dist/browser-cjs/src/core/util/browser.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/delay.d.ts +31 -0
- package/dist/browser-cjs/src/core/util/delay.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/emulator.d.ts +18 -0
- package/dist/browser-cjs/src/core/util/emulator.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/event_id.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/event_id.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/fetch_provider.d.ts +25 -0
- package/dist/browser-cjs/src/core/util/handler.d.ts +20 -0
- package/dist/browser-cjs/src/core/util/instantiator.d.ts +28 -0
- package/dist/browser-cjs/src/core/util/instantiator.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/location.d.ts +19 -0
- package/dist/browser-cjs/src/core/util/log.d.ts +22 -0
- package/dist/browser-cjs/src/core/util/navigator.d.ts +21 -0
- package/dist/browser-cjs/src/core/util/providers.d.ts +23 -0
- package/dist/browser-cjs/src/core/util/resolver.d.ts +25 -0
- package/dist/browser-cjs/src/core/util/time.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/validate_origin.d.ts +18 -0
- package/dist/browser-cjs/src/core/util/validate_origin.test.d.ts +17 -0
- package/dist/browser-cjs/src/core/util/version.d.ts +30 -0
- package/dist/browser-cjs/src/core/util/version.test.d.ts +17 -0
- package/dist/browser-cjs/src/index.d.ts +18 -0
- package/dist/browser-cjs/src/mfa/index.d.ts +18 -0
- package/dist/browser-cjs/src/mfa/mfa_assertion.d.ts +27 -0
- package/dist/browser-cjs/src/mfa/mfa_error.d.ts +35 -0
- package/dist/browser-cjs/src/mfa/mfa_info.d.ts +32 -0
- package/dist/browser-cjs/src/mfa/mfa_info.test.d.ts +17 -0
- package/dist/browser-cjs/src/mfa/mfa_resolver.d.ts +41 -0
- package/dist/browser-cjs/src/mfa/mfa_resolver.test.d.ts +17 -0
- package/dist/browser-cjs/src/mfa/mfa_session.d.ts +39 -0
- package/dist/browser-cjs/src/mfa/mfa_session.test.d.ts +17 -0
- package/dist/browser-cjs/src/mfa/mfa_user.d.ts +38 -0
- package/dist/browser-cjs/src/mfa/mfa_user.test.d.ts +17 -0
- package/dist/browser-cjs/src/model/application_verifier.d.ts +23 -0
- package/dist/browser-cjs/src/model/auth.d.ts +75 -0
- package/dist/browser-cjs/src/model/enum_maps.d.ts +97 -0
- package/dist/browser-cjs/src/model/enums.d.ts +74 -0
- package/dist/browser-cjs/src/model/id_token.d.ts +87 -0
- package/dist/browser-cjs/src/model/popup_redirect.d.ts +94 -0
- package/dist/browser-cjs/src/model/public_types.d.ts +1162 -0
- package/dist/browser-cjs/src/model/user.d.ts +83 -0
- package/dist/browser-cjs/src/platform_browser/auth.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/auth_window.d.ts +37 -0
- package/dist/browser-cjs/src/platform_browser/iframe/gapi.d.ts +19 -0
- package/dist/browser-cjs/src/platform_browser/iframe/gapi.iframes.d.ts +47 -0
- package/dist/browser-cjs/src/platform_browser/iframe/gapi.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/iframe/iframe.d.ts +18 -0
- package/dist/browser-cjs/src/platform_browser/iframe/iframe.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/index.d.ts +27 -0
- package/dist/browser-cjs/src/platform_browser/load_js.d.ts +18 -0
- package/dist/browser-cjs/src/platform_browser/load_js.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/messagechannel/index.d.ts +87 -0
- package/dist/browser-cjs/src/platform_browser/messagechannel/promise.d.ts +33 -0
- package/dist/browser-cjs/src/platform_browser/messagechannel/promise.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/messagechannel/receiver.d.ts +63 -0
- package/dist/browser-cjs/src/platform_browser/messagechannel/receiver.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/messagechannel/sender.d.ts +46 -0
- package/dist/browser-cjs/src/platform_browser/messagechannel/sender.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/mfa/assertions/phone.d.ts +56 -0
- package/dist/browser-cjs/src/platform_browser/mfa/assertions/phone.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/persistence/browser.d.ts +27 -0
- package/dist/browser-cjs/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/persistence/indexed_db.d.ts +33 -0
- package/dist/browser-cjs/src/platform_browser/persistence/indexed_db.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/persistence/local_storage.d.ts +25 -0
- package/dist/browser-cjs/src/platform_browser/persistence/local_storage.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/persistence/session_storage.d.ts +24 -0
- package/dist/browser-cjs/src/platform_browser/persistence/session_storage.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/popup_redirect.d.ts +24 -0
- package/dist/browser-cjs/src/platform_browser/popup_redirect.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/providers/phone.d.ts +149 -0
- package/dist/browser-cjs/src/platform_browser/providers/phone.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha.d.ts +23 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_loader.d.ts +49 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_loader.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_mock.d.ts +51 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_mock.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_verifier.d.ts +90 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_verifier.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/strategies/phone.d.ts +98 -0
- package/dist/browser-cjs/src/platform_browser/strategies/phone.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/strategies/popup.d.ts +103 -0
- package/dist/browser-cjs/src/platform_browser/strategies/popup.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/strategies/redirect.d.ts +165 -0
- package/dist/browser-cjs/src/platform_browser/strategies/redirect.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/util/popup.d.ts +24 -0
- package/dist/browser-cjs/src/platform_browser/util/popup.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/util/worker.d.ts +20 -0
- package/dist/browser-cjs/src/platform_cordova/plugins.d.ts +42 -0
- package/dist/browser-cjs/src/platform_cordova/popup_redirect/events.d.ts +39 -0
- package/dist/browser-cjs/src/platform_cordova/popup_redirect/events.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_cordova/popup_redirect/popup_redirect.d.ts +24 -0
- package/dist/browser-cjs/src/platform_cordova/popup_redirect/popup_redirect.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_cordova/popup_redirect/utils.d.ts +47 -0
- package/dist/browser-cjs/src/platform_cordova/popup_redirect/utils.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_cordova/strategies/redirect.d.ts +20 -0
- package/dist/browser-cjs/src/platform_node/index.d.ts +49 -0
- package/dist/browser-cjs/src/platform_react_native/persistence/react_native.d.ts +25 -0
- package/dist/browser-cjs/src/platform_react_native/persistence/react_native.test.d.ts +17 -0
- package/dist/browser-cjs/test/helpers/api/helper.d.ts +20 -0
- package/dist/browser-cjs/test/helpers/delay.d.ts +20 -0
- package/dist/browser-cjs/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/browser-cjs/test/helpers/fake_service_worker.d.ts +22 -0
- package/dist/browser-cjs/test/helpers/id_token_response.d.ts +18 -0
- package/dist/browser-cjs/test/helpers/iframe_event.d.ts +19 -0
- package/dist/browser-cjs/test/helpers/integration/emulator_rest_helpers.d.ts +35 -0
- package/dist/browser-cjs/test/helpers/integration/helpers.d.ts +20 -0
- package/dist/browser-cjs/test/helpers/integration/settings.d.ts +23 -0
- package/dist/browser-cjs/test/helpers/jwt.d.ts +17 -0
- package/dist/browser-cjs/test/helpers/mock_auth.d.ts +42 -0
- package/dist/browser-cjs/test/helpers/mock_auth_credential.d.ts +31 -0
- package/dist/browser-cjs/test/helpers/mock_fetch.d.ts +30 -0
- package/dist/browser-cjs/test/helpers/mock_fetch.test.d.ts +17 -0
- package/dist/browser-cjs/test/helpers/mock_popup_redirect_resolver.d.ts +24 -0
- package/dist/browser-cjs/test/helpers/redirect_persistence.d.ts +24 -0
- package/dist/browser-cjs/test/helpers/timeout_stub.d.ts +34 -0
- package/dist/browser-cjs/test/integration/flows/anonymous.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/flows/custom.local.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/flows/email.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/flows/idp.local.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/flows/middleware_test_generator.d.ts +18 -0
- package/dist/browser-cjs/test/integration/flows/oob.local.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/flows/phone.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/webdriver/anonymous.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/webdriver/compat/firebaseui.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/webdriver/persistence.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/webdriver/popup.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/webdriver/redirect.test.d.ts +17 -0
- package/dist/browser-cjs/test/integration/webdriver/util/auth_driver.d.ts +46 -0
- package/dist/browser-cjs/test/integration/webdriver/util/functions.d.ts +81 -0
- package/dist/browser-cjs/test/integration/webdriver/util/idp_page.d.ts +31 -0
- package/dist/browser-cjs/test/integration/webdriver/util/js_load_condition.d.ts +25 -0
- package/dist/browser-cjs/test/integration/webdriver/util/test_runner.d.ts +19 -0
- package/dist/browser-cjs/test/integration/webdriver/util/test_server.d.ts +27 -0
- package/dist/browser-cjs/test/integration/webdriver/util/ui_page.d.ts +33 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +2 -2
- package/dist/cordova/{popup_redirect-f2a91123.js → popup_redirect-25d75288.js} +16 -15
- package/dist/cordova/popup_redirect-25d75288.js.map +1 -0
- package/dist/cordova/src/core/strategies/credential.d.ts +2 -1
- package/dist/cordova/src/platform_browser/strategies/redirect.d.ts +6 -3
- package/dist/esm2017/{index-e5b3cc81.js → index-b10e00ad.js} +22 -20
- package/dist/esm2017/index-b10e00ad.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/core/strategies/credential.d.ts +2 -1
- package/dist/esm2017/src/platform_browser/strategies/redirect.d.ts +6 -3
- package/dist/esm5/{index-624a9c08.js → index-c2c7ec8a.js} +16 -15
- package/dist/esm5/index-c2c7ec8a.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/core/strategies/credential.d.ts +2 -1
- package/dist/esm5/src/platform_browser/strategies/redirect.d.ts +6 -3
- package/dist/index.webworker.esm5.js +9 -11
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-69e083b1.js → index-173e1445.js} +10 -12
- package/dist/node/{index-69e083b1.js.map → index-173e1445.js.map} +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/core/strategies/credential.d.ts +2 -1
- package/dist/node/src/platform_browser/strategies/redirect.d.ts +6 -3
- package/dist/node-esm/{index-67ff6dfa.js → index-d3f6ac28.js} +16 -17
- package/dist/node-esm/{index-67ff6dfa.js.map → index-d3f6ac28.js.map} +1 -1
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/node-esm/src/core/strategies/credential.d.ts +2 -1
- package/dist/node-esm/src/platform_browser/strategies/redirect.d.ts +6 -3
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +7 -4
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-ec5655af.js → phone-d07e6704.js} +10 -12
- package/dist/rn/phone-d07e6704.js.map +1 -0
- package/dist/rn/src/core/strategies/credential.d.ts +2 -1
- package/dist/rn/src/platform_browser/strategies/redirect.d.ts +6 -3
- package/dist/src/core/strategies/credential.d.ts +2 -1
- package/dist/src/platform_browser/strategies/redirect.d.ts +6 -3
- package/package.json +15 -7
- package/dist/cordova/popup_redirect-f2a91123.js.map +0 -1
- package/dist/esm2017/index-e5b3cc81.js.map +0 -1
- package/dist/esm5/index-624a9c08.js.map +0 -1
- package/dist/rn/phone-ec5655af.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { PersistenceValue, PersistenceType } from '../../core/persistence';
|
|
18
|
+
export declare abstract class BrowserPersistenceClass {
|
|
19
|
+
protected readonly storageRetriever: () => Storage;
|
|
20
|
+
readonly type: PersistenceType;
|
|
21
|
+
protected constructor(storageRetriever: () => Storage, type: PersistenceType);
|
|
22
|
+
_isAvailable(): Promise<boolean>;
|
|
23
|
+
_set(key: string, value: PersistenceValue): Promise<void>;
|
|
24
|
+
_get<T extends PersistenceValue>(key: string): Promise<T | null>;
|
|
25
|
+
_remove(key: string): Promise<void>;
|
|
26
|
+
protected get storage(): Storage;
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Persistence } from '../../model/public_types';
|
|
18
|
+
import { PersistenceValue } from '../../core/persistence/';
|
|
19
|
+
export declare const DB_NAME = "firebaseLocalStorageDb";
|
|
20
|
+
export declare function _clearDatabase(db: IDBDatabase): Promise<void>;
|
|
21
|
+
export declare function _deleteDatabase(): Promise<void>;
|
|
22
|
+
export declare function _openDatabase(): Promise<IDBDatabase>;
|
|
23
|
+
export declare function _putObject(db: IDBDatabase, key: string, value: PersistenceValue | string): Promise<void>;
|
|
24
|
+
export declare function _deleteObject(db: IDBDatabase, key: string): Promise<void>;
|
|
25
|
+
export declare const _POLLING_INTERVAL_MS = 800;
|
|
26
|
+
export declare const _TRANSACTION_RETRY_COUNT = 3;
|
|
27
|
+
/**
|
|
28
|
+
* An implementation of {@link Persistence} of type `LOCAL` using `indexedDB`
|
|
29
|
+
* for the underlying storage.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export declare const indexedDBLocalPersistence: Persistence;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Persistence } from '../../model/public_types';
|
|
18
|
+
export declare const _POLLING_INTERVAL_MS = 1000;
|
|
19
|
+
/**
|
|
20
|
+
* An implementation of {@link Persistence} of type `LOCAL` using `localStorage`
|
|
21
|
+
* for the underlying storage.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare const browserLocalPersistence: Persistence;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Persistence } from '../../model/public_types';
|
|
18
|
+
/**
|
|
19
|
+
* An implementation of {@link Persistence} of `SESSION` using `sessionStorage`
|
|
20
|
+
* for the underlying storage.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const browserSessionPersistence: Persistence;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { PopupRedirectResolver } from '../model/public_types';
|
|
18
|
+
/**
|
|
19
|
+
* An implementation of {@link PopupRedirectResolver} suitable for browser
|
|
20
|
+
* based applications.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const browserPopupRedirectResolver: PopupRedirectResolver;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Auth, PhoneInfoOptions, ApplicationVerifier, UserCredential } from '../../model/public_types';
|
|
18
|
+
import { PhoneAuthCredential } from '../../core/credentials/phone';
|
|
19
|
+
import { AuthCredential } from '../../core';
|
|
20
|
+
import { FirebaseError } from '@firebase/util';
|
|
21
|
+
/**
|
|
22
|
+
* Provider for generating an {@link PhoneAuthCredential}.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```javascript
|
|
26
|
+
* // 'recaptcha-container' is the ID of an element in the DOM.
|
|
27
|
+
* const applicationVerifier = new RecaptchaVerifier('recaptcha-container');
|
|
28
|
+
* const provider = new PhoneAuthProvider(auth);
|
|
29
|
+
* const verificationId = await provider.verifyPhoneNumber('+16505550101', applicationVerifier);
|
|
30
|
+
* // Obtain the verificationCode from the user.
|
|
31
|
+
* const phoneCredential = PhoneAuthProvider.credential(verificationId, verificationCode);
|
|
32
|
+
* const userCredential = await signInWithCredential(auth, phoneCredential);
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export declare class PhoneAuthProvider {
|
|
38
|
+
/** Always set to {@link ProviderId}.PHONE. */
|
|
39
|
+
static readonly PROVIDER_ID: 'phone';
|
|
40
|
+
/** Always set to {@link SignInMethod}.PHONE. */
|
|
41
|
+
static readonly PHONE_SIGN_IN_METHOD: 'phone';
|
|
42
|
+
/** Always set to {@link ProviderId}.PHONE. */
|
|
43
|
+
readonly providerId: "phone";
|
|
44
|
+
private readonly auth;
|
|
45
|
+
/**
|
|
46
|
+
* @param auth - The Firebase {@link Auth} instance in which sign-ins should occur.
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
constructor(auth: Auth);
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* Starts a phone number authentication flow by sending a verification code to the given phone
|
|
53
|
+
* number.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```javascript
|
|
57
|
+
* const provider = new PhoneAuthProvider(auth);
|
|
58
|
+
* const verificationId = await provider.verifyPhoneNumber(phoneNumber, applicationVerifier);
|
|
59
|
+
* // Obtain verificationCode from the user.
|
|
60
|
+
* const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);
|
|
61
|
+
* const userCredential = await signInWithCredential(auth, authCredential);
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* An alternative flow is provided using the `signInWithPhoneNumber` method.
|
|
66
|
+
* ```javascript
|
|
67
|
+
* const confirmationResult = signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);
|
|
68
|
+
* // Obtain verificationCode from the user.
|
|
69
|
+
* const userCredential = confirmationResult.confirm(verificationCode);
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @param phoneInfoOptions - The user's {@link PhoneInfoOptions}. The phone number should be in
|
|
73
|
+
* E.164 format (e.g. +16505550101).
|
|
74
|
+
* @param applicationVerifier - For abuse prevention, this method also requires a
|
|
75
|
+
* {@link ApplicationVerifier}. This SDK includes a reCAPTCHA-based implementation,
|
|
76
|
+
* {@link RecaptchaVerifier}.
|
|
77
|
+
*
|
|
78
|
+
* @returns A Promise for a verification ID that can be passed to
|
|
79
|
+
* {@link PhoneAuthProvider.credential} to identify this flow..
|
|
80
|
+
*/
|
|
81
|
+
verifyPhoneNumber(phoneOptions: PhoneInfoOptions | string, applicationVerifier: ApplicationVerifier): Promise<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Creates a phone auth credential, given the verification ID from
|
|
84
|
+
* {@link PhoneAuthProvider.verifyPhoneNumber} and the code that was sent to the user's
|
|
85
|
+
* mobile device.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```javascript
|
|
89
|
+
* const provider = new PhoneAuthProvider(auth);
|
|
90
|
+
* const verificationId = provider.verifyPhoneNumber(phoneNumber, applicationVerifier);
|
|
91
|
+
* // Obtain verificationCode from the user.
|
|
92
|
+
* const authCredential = PhoneAuthProvider.credential(verificationId, verificationCode);
|
|
93
|
+
* const userCredential = signInWithCredential(auth, authCredential);
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* An alternative flow is provided using the `signInWithPhoneNumber` method.
|
|
98
|
+
* ```javascript
|
|
99
|
+
* const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);
|
|
100
|
+
* // Obtain verificationCode from the user.
|
|
101
|
+
* const userCredential = await confirmationResult.confirm(verificationCode);
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @param verificationId - The verification ID returned from {@link PhoneAuthProvider.verifyPhoneNumber}.
|
|
105
|
+
* @param verificationCode - The verification code sent to the user's mobile device.
|
|
106
|
+
*
|
|
107
|
+
* @returns The auth provider credential.
|
|
108
|
+
*/
|
|
109
|
+
static credential(verificationId: string, verificationCode: string): PhoneAuthCredential;
|
|
110
|
+
/**
|
|
111
|
+
* Generates an {@link AuthCredential} from a {@link UserCredential}.
|
|
112
|
+
* @param userCredential - The user credential.
|
|
113
|
+
*/
|
|
114
|
+
static credentialFromResult(userCredential: UserCredential): AuthCredential | null;
|
|
115
|
+
/**
|
|
116
|
+
* Returns an {@link AuthCredential} when passed an error.
|
|
117
|
+
*
|
|
118
|
+
* @remarks
|
|
119
|
+
*
|
|
120
|
+
* This method works for errors like
|
|
121
|
+
* `auth/account-exists-with-different-credentials`. This is useful for
|
|
122
|
+
* recovering when attempting to set a user's phone number but the number
|
|
123
|
+
* in question is already tied to another account. For example, the following
|
|
124
|
+
* code tries to update the current user's phone number, and if that
|
|
125
|
+
* fails, links the user with the account associated with that number:
|
|
126
|
+
*
|
|
127
|
+
* ```js
|
|
128
|
+
* const provider = new PhoneAuthProvider(auth);
|
|
129
|
+
* const verificationId = await provider.verifyPhoneNumber(number, verifier);
|
|
130
|
+
* try {
|
|
131
|
+
* const code = ''; // Prompt the user for the verification code
|
|
132
|
+
* await updatePhoneNumber(
|
|
133
|
+
* auth.currentUser,
|
|
134
|
+
* PhoneAuthProvider.credential(verificationId, code));
|
|
135
|
+
* } catch (e) {
|
|
136
|
+
* if ((e as FirebaseError)?.code === 'auth/account-exists-with-different-credential') {
|
|
137
|
+
* const cred = PhoneAuthProvider.credentialFromError(e);
|
|
138
|
+
* await linkWithCredential(auth.currentUser, cred);
|
|
139
|
+
* }
|
|
140
|
+
* }
|
|
141
|
+
*
|
|
142
|
+
* // At this point, auth.currentUser.phoneNumber === number.
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* @param error - The error to generate a credential from.
|
|
146
|
+
*/
|
|
147
|
+
static credentialFromError(error: FirebaseError): AuthCredential | null;
|
|
148
|
+
private static credentialFromTaggedObject;
|
|
149
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { RecaptchaParameters } from '../../model/public_types';
|
|
18
|
+
export interface Recaptcha {
|
|
19
|
+
render: (container: HTMLElement, parameters: RecaptchaParameters) => number;
|
|
20
|
+
getResponse: (id: number) => string;
|
|
21
|
+
execute: (id: number) => unknown;
|
|
22
|
+
reset: (id: number) => unknown;
|
|
23
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { AuthInternal } from '../../model/auth';
|
|
18
|
+
import { Recaptcha } from './recaptcha';
|
|
19
|
+
export declare const _JSLOAD_CALLBACK: string;
|
|
20
|
+
/**
|
|
21
|
+
* We need to mark this interface as internal explicitly to exclude it in the public typings, because
|
|
22
|
+
* it references AuthInternal which has a circular dependency with UserInternal.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export interface ReCaptchaLoader {
|
|
27
|
+
load(auth: AuthInternal, hl?: string): Promise<Recaptcha>;
|
|
28
|
+
clearedOneInstance(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Loader for the GReCaptcha library. There should only ever be one of this.
|
|
32
|
+
*/
|
|
33
|
+
export declare class ReCaptchaLoaderImpl implements ReCaptchaLoader {
|
|
34
|
+
private hostLanguage;
|
|
35
|
+
private counter;
|
|
36
|
+
/**
|
|
37
|
+
* Check for `render()` method. `window.grecaptcha` will exist if the Enterprise
|
|
38
|
+
* version of the ReCAPTCHA script was loaded by someone else (e.g. App Check) but
|
|
39
|
+
* `window.grecaptcha.render()` will not. Another load will add it.
|
|
40
|
+
*/
|
|
41
|
+
private readonly librarySeparatelyLoaded;
|
|
42
|
+
load(auth: AuthInternal, hl?: string): Promise<Recaptcha>;
|
|
43
|
+
clearedOneInstance(): void;
|
|
44
|
+
private shouldResolveImmediately;
|
|
45
|
+
}
|
|
46
|
+
export declare class MockReCaptchaLoaderImpl implements ReCaptchaLoader {
|
|
47
|
+
load(auth: AuthInternal): Promise<Recaptcha>;
|
|
48
|
+
clearedOneInstance(): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { AuthInternal } from '../../model/auth';
|
|
18
|
+
import { RecaptchaParameters } from '../../model/public_types';
|
|
19
|
+
import { Recaptcha } from './recaptcha';
|
|
20
|
+
export declare const _SOLVE_TIME_MS = 500;
|
|
21
|
+
export declare const _EXPIRATION_TIME_MS = 60000;
|
|
22
|
+
export declare const _WIDGET_ID_START = 1000000000000;
|
|
23
|
+
export interface Widget {
|
|
24
|
+
getResponse: () => string | null;
|
|
25
|
+
delete: () => void;
|
|
26
|
+
execute: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare class MockReCaptcha implements Recaptcha {
|
|
29
|
+
private readonly auth;
|
|
30
|
+
private counter;
|
|
31
|
+
_widgets: Map<number, Widget>;
|
|
32
|
+
constructor(auth: AuthInternal);
|
|
33
|
+
render(container: string | HTMLElement, parameters?: RecaptchaParameters): number;
|
|
34
|
+
reset(optWidgetId?: number): void;
|
|
35
|
+
getResponse(optWidgetId?: number): string;
|
|
36
|
+
execute(optWidgetId?: number | string): Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
export declare class MockWidget {
|
|
39
|
+
private readonly params;
|
|
40
|
+
private readonly container;
|
|
41
|
+
private readonly isVisible;
|
|
42
|
+
private timerId;
|
|
43
|
+
private deleted;
|
|
44
|
+
private responseToken;
|
|
45
|
+
private readonly clickHandler;
|
|
46
|
+
constructor(containerOrId: string | HTMLElement, appName: string, params: RecaptchaParameters);
|
|
47
|
+
getResponse(): string | null;
|
|
48
|
+
delete(): void;
|
|
49
|
+
execute(): void;
|
|
50
|
+
private checkIfDeleted;
|
|
51
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Auth, RecaptchaParameters } from '../../model/public_types';
|
|
18
|
+
import { ApplicationVerifierInternal } from '../../model/application_verifier';
|
|
19
|
+
import { ReCaptchaLoader } from './recaptcha_loader';
|
|
20
|
+
export declare const RECAPTCHA_VERIFIER_TYPE = "recaptcha";
|
|
21
|
+
/**
|
|
22
|
+
* An {@link https://www.google.com/recaptcha/ | reCAPTCHA}-based application verifier.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export declare class RecaptchaVerifier implements ApplicationVerifierInternal {
|
|
27
|
+
private readonly parameters;
|
|
28
|
+
/**
|
|
29
|
+
* The application verifier type.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* For a reCAPTCHA verifier, this is 'recaptcha'.
|
|
33
|
+
*/
|
|
34
|
+
readonly type = "recaptcha";
|
|
35
|
+
private destroyed;
|
|
36
|
+
private widgetId;
|
|
37
|
+
private readonly container;
|
|
38
|
+
private readonly isInvisible;
|
|
39
|
+
private readonly tokenChangeListeners;
|
|
40
|
+
private renderPromise;
|
|
41
|
+
private readonly auth;
|
|
42
|
+
/** @internal */
|
|
43
|
+
readonly _recaptchaLoader: ReCaptchaLoader;
|
|
44
|
+
private recaptcha;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param containerOrId - The reCAPTCHA container parameter.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* This has different meaning depending on whether the reCAPTCHA is hidden or visible. For a
|
|
51
|
+
* visible reCAPTCHA the container must be empty. If a string is used, it has to correspond to
|
|
52
|
+
* an element ID. The corresponding element must also must be in the DOM at the time of
|
|
53
|
+
* initialization.
|
|
54
|
+
*
|
|
55
|
+
* @param parameters - The optional reCAPTCHA parameters.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* Check the reCAPTCHA docs for a comprehensive list. All parameters are accepted except for
|
|
59
|
+
* the sitekey. Firebase Auth backend provisions a reCAPTCHA for each project and will
|
|
60
|
+
* configure this upon rendering. For an invisible reCAPTCHA, a size key must have the value
|
|
61
|
+
* 'invisible'.
|
|
62
|
+
*
|
|
63
|
+
* @param authExtern - The corresponding Firebase {@link Auth} instance.
|
|
64
|
+
*/
|
|
65
|
+
constructor(containerOrId: HTMLElement | string, parameters: RecaptchaParameters, authExtern: Auth);
|
|
66
|
+
/**
|
|
67
|
+
* Waits for the user to solve the reCAPTCHA and resolves with the reCAPTCHA token.
|
|
68
|
+
*
|
|
69
|
+
* @returns A Promise for the reCAPTCHA token.
|
|
70
|
+
*/
|
|
71
|
+
verify(): Promise<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Renders the reCAPTCHA widget on the page.
|
|
74
|
+
*
|
|
75
|
+
* @returns A Promise that resolves with the reCAPTCHA widget ID.
|
|
76
|
+
*/
|
|
77
|
+
render(): Promise<number>;
|
|
78
|
+
/** @internal */
|
|
79
|
+
_reset(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Clears the reCAPTCHA widget from the page and destroys the instance.
|
|
82
|
+
*/
|
|
83
|
+
clear(): void;
|
|
84
|
+
private validateStartingState;
|
|
85
|
+
private makeTokenCallback;
|
|
86
|
+
private assertNotDestroyed;
|
|
87
|
+
private makeRenderPromise;
|
|
88
|
+
private init;
|
|
89
|
+
private getAssertedRecaptcha;
|
|
90
|
+
}
|