@firebase/auth 0.22.0 → 0.23.0-canary.0832dcac2
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 +8 -0
- package/dist/auth-public.d.ts +57 -0
- package/dist/auth.d.ts +71 -1
- package/dist/browser-cjs/{index-5859881d.js → index-67779ffd.js} +590 -207
- package/dist/browser-cjs/index-67779ffd.js.map +1 -0
- package/dist/browser-cjs/index.js +3 -2
- package/dist/browser-cjs/index.js.map +1 -1
- package/dist/browser-cjs/internal.js +3 -2
- package/dist/browser-cjs/internal.js.map +1 -1
- package/dist/browser-cjs/src/api/authentication/email_and_password.d.ts +9 -0
- package/dist/browser-cjs/src/api/authentication/recaptcha.d.ts +16 -0
- package/dist/browser-cjs/src/api/authentication/sign_up.d.ts +4 -0
- package/dist/browser-cjs/src/api/errors.d.ts +9 -1
- package/dist/browser-cjs/src/api/index.d.ts +17 -2
- package/dist/browser-cjs/src/core/auth/auth_impl.d.ts +9 -1
- package/dist/browser-cjs/src/core/errors.d.ts +17 -1
- package/dist/browser-cjs/src/core/index.d.ts +26 -0
- package/dist/browser-cjs/src/core/util/handler.d.ts +1 -1
- package/dist/browser-cjs/src/core/util/log.d.ts +1 -0
- package/dist/browser-cjs/src/model/auth.d.ts +6 -0
- package/dist/browser-cjs/src/platform_browser/auth_window.d.ts +2 -2
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha.d.ts +33 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +40 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts +17 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_mock.d.ts +16 -1
- package/dist/browser-cjs/src/platform_browser/strategies/popup.d.ts +1 -1
- package/dist/browser-cjs/test/helpers/api/helper.d.ts +2 -0
- package/dist/browser-cjs/test/helpers/mock_auth.d.ts +5 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +21 -77
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-3519667a.js → popup_redirect-cc44b4cd.js} +778 -214
- package/dist/cordova/popup_redirect-cc44b4cd.js.map +1 -0
- package/dist/cordova/src/api/authentication/email_and_password.d.ts +9 -0
- package/dist/cordova/src/api/authentication/recaptcha.d.ts +16 -0
- package/dist/cordova/src/api/authentication/sign_up.d.ts +4 -0
- package/dist/cordova/src/api/errors.d.ts +9 -1
- package/dist/cordova/src/api/index.d.ts +17 -2
- package/dist/cordova/src/core/auth/auth_impl.d.ts +9 -1
- package/dist/cordova/src/core/errors.d.ts +17 -1
- package/dist/cordova/src/core/index.d.ts +26 -0
- package/dist/cordova/src/core/util/handler.d.ts +1 -1
- package/dist/cordova/src/core/util/log.d.ts +1 -0
- package/dist/cordova/src/model/auth.d.ts +6 -0
- package/dist/cordova/src/platform_browser/auth_window.d.ts +2 -2
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha.d.ts +33 -0
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha.test.d.ts +17 -0
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +40 -0
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts +17 -0
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha_mock.d.ts +16 -1
- package/dist/cordova/src/platform_browser/strategies/popup.d.ts +1 -1
- package/dist/cordova/test/helpers/api/helper.d.ts +2 -0
- package/dist/cordova/test/helpers/mock_auth.d.ts +5 -0
- package/dist/esm2017/{index-680e2b70.js → index-55c8f96e.js} +591 -209
- package/dist/esm2017/index-55c8f96e.js.map +1 -0
- package/dist/esm2017/index.js +2 -2
- package/dist/esm2017/internal.js +3 -3
- package/dist/esm2017/src/api/authentication/email_and_password.d.ts +9 -0
- package/dist/esm2017/src/api/authentication/recaptcha.d.ts +16 -0
- package/dist/esm2017/src/api/authentication/sign_up.d.ts +4 -0
- package/dist/esm2017/src/api/errors.d.ts +9 -1
- package/dist/esm2017/src/api/index.d.ts +17 -2
- package/dist/esm2017/src/core/auth/auth_impl.d.ts +9 -1
- package/dist/esm2017/src/core/errors.d.ts +17 -1
- package/dist/esm2017/src/core/index.d.ts +26 -0
- package/dist/esm2017/src/core/util/handler.d.ts +1 -1
- package/dist/esm2017/src/core/util/log.d.ts +1 -0
- package/dist/esm2017/src/model/auth.d.ts +6 -0
- package/dist/esm2017/src/platform_browser/auth_window.d.ts +2 -2
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha.d.ts +33 -0
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha.test.d.ts +17 -0
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +40 -0
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts +17 -0
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha_mock.d.ts +16 -1
- package/dist/esm2017/src/platform_browser/strategies/popup.d.ts +1 -1
- package/dist/esm2017/test/helpers/api/helper.d.ts +2 -0
- package/dist/esm2017/test/helpers/mock_auth.d.ts +5 -0
- package/dist/esm5/{index-714e827f.js → index-ce1e2136.js} +797 -289
- package/dist/esm5/index-ce1e2136.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/api/authentication/email_and_password.d.ts +9 -0
- package/dist/esm5/src/api/authentication/recaptcha.d.ts +16 -0
- package/dist/esm5/src/api/authentication/sign_up.d.ts +4 -0
- package/dist/esm5/src/api/errors.d.ts +9 -1
- package/dist/esm5/src/api/index.d.ts +17 -2
- package/dist/esm5/src/core/auth/auth_impl.d.ts +9 -1
- package/dist/esm5/src/core/errors.d.ts +17 -1
- package/dist/esm5/src/core/index.d.ts +26 -0
- package/dist/esm5/src/core/util/handler.d.ts +1 -1
- package/dist/esm5/src/core/util/log.d.ts +1 -0
- package/dist/esm5/src/model/auth.d.ts +6 -0
- package/dist/esm5/src/platform_browser/auth_window.d.ts +2 -2
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha.d.ts +33 -0
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha.test.d.ts +17 -0
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +40 -0
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts +17 -0
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha_mock.d.ts +16 -1
- package/dist/esm5/src/platform_browser/strategies/popup.d.ts +1 -1
- package/dist/esm5/test/helpers/api/helper.d.ts +2 -0
- package/dist/esm5/test/helpers/mock_auth.d.ts +5 -0
- package/dist/index.webworker.esm5.js +602 -74
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/index.js +2 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/internal.js +62 -42
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/api/authentication/email_and_password.d.ts +9 -0
- package/dist/node/src/api/authentication/recaptcha.d.ts +16 -0
- package/dist/node/src/api/authentication/sign_up.d.ts +4 -0
- package/dist/node/src/api/errors.d.ts +9 -1
- package/dist/node/src/api/index.d.ts +17 -2
- package/dist/node/src/core/auth/auth_impl.d.ts +9 -1
- package/dist/node/src/core/errors.d.ts +17 -1
- package/dist/node/src/core/index.d.ts +26 -0
- package/dist/node/src/core/util/handler.d.ts +1 -1
- package/dist/node/src/core/util/log.d.ts +1 -0
- package/dist/node/src/model/auth.d.ts +6 -0
- package/dist/node/src/platform_browser/auth_window.d.ts +2 -2
- package/dist/node/src/platform_browser/recaptcha/recaptcha.d.ts +33 -0
- package/dist/node/src/platform_browser/recaptcha/recaptcha.test.d.ts +17 -0
- package/dist/node/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +40 -0
- package/dist/node/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts +17 -0
- package/dist/node/src/platform_browser/recaptcha/recaptcha_mock.d.ts +16 -1
- package/dist/node/src/platform_browser/strategies/popup.d.ts +1 -1
- package/dist/node/test/helpers/api/helper.d.ts +2 -0
- package/dist/node/test/helpers/mock_auth.d.ts +5 -0
- package/dist/node/{totp-416a2adc.js → totp-a3dac803.js} +700 -171
- package/dist/node/totp-a3dac803.js.map +1 -0
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +16 -4
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/node-esm/src/api/authentication/email_and_password.d.ts +9 -0
- package/dist/node-esm/src/api/authentication/recaptcha.d.ts +16 -0
- package/dist/node-esm/src/api/authentication/sign_up.d.ts +4 -0
- package/dist/node-esm/src/api/errors.d.ts +9 -1
- package/dist/node-esm/src/api/index.d.ts +17 -2
- package/dist/node-esm/src/core/auth/auth_impl.d.ts +9 -1
- package/dist/node-esm/src/core/errors.d.ts +17 -1
- package/dist/node-esm/src/core/index.d.ts +26 -0
- package/dist/node-esm/src/core/util/handler.d.ts +1 -1
- package/dist/node-esm/src/core/util/log.d.ts +1 -0
- package/dist/node-esm/src/model/auth.d.ts +6 -0
- package/dist/node-esm/src/platform_browser/auth_window.d.ts +2 -2
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha.d.ts +33 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +40 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts +17 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_mock.d.ts +16 -1
- package/dist/node-esm/src/platform_browser/strategies/popup.d.ts +1 -1
- package/dist/node-esm/test/helpers/api/helper.d.ts +2 -0
- package/dist/node-esm/test/helpers/mock_auth.d.ts +5 -0
- package/dist/node-esm/{totp-c3bf2a20.js → totp-65fbfdbe.js} +557 -140
- package/dist/node-esm/totp-65fbfdbe.js.map +1 -0
- package/dist/rn/index.js +2 -1
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/internal.js +79 -48
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-2ec1815d.js → phone-97108d6a.js} +738 -259
- package/dist/rn/phone-97108d6a.js.map +1 -0
- package/dist/rn/src/api/authentication/email_and_password.d.ts +9 -0
- package/dist/rn/src/api/authentication/recaptcha.d.ts +16 -0
- package/dist/rn/src/api/authentication/sign_up.d.ts +4 -0
- package/dist/rn/src/api/errors.d.ts +9 -1
- package/dist/rn/src/api/index.d.ts +17 -2
- package/dist/rn/src/core/auth/auth_impl.d.ts +9 -1
- package/dist/rn/src/core/errors.d.ts +17 -1
- package/dist/rn/src/core/index.d.ts +26 -0
- package/dist/rn/src/core/util/handler.d.ts +1 -1
- package/dist/rn/src/core/util/log.d.ts +1 -0
- package/dist/rn/src/model/auth.d.ts +6 -0
- package/dist/rn/src/platform_browser/auth_window.d.ts +2 -2
- package/dist/rn/src/platform_browser/recaptcha/recaptcha.d.ts +33 -0
- package/dist/rn/src/platform_browser/recaptcha/recaptcha.test.d.ts +17 -0
- package/dist/rn/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +40 -0
- package/dist/rn/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts +17 -0
- package/dist/rn/src/platform_browser/recaptcha/recaptcha_mock.d.ts +16 -1
- package/dist/rn/src/platform_browser/strategies/popup.d.ts +1 -1
- package/dist/rn/test/helpers/api/helper.d.ts +2 -0
- package/dist/rn/test/helpers/mock_auth.d.ts +5 -0
- package/dist/src/api/authentication/email_and_password.d.ts +9 -0
- package/dist/src/api/authentication/recaptcha.d.ts +16 -0
- package/dist/src/api/authentication/sign_up.d.ts +4 -0
- package/dist/src/api/errors.d.ts +9 -1
- package/dist/src/api/index.d.ts +17 -2
- package/dist/src/core/auth/auth_impl.d.ts +9 -1
- package/dist/src/core/errors.d.ts +17 -1
- package/dist/src/core/index.d.ts +26 -0
- package/dist/src/core/util/handler.d.ts +1 -1
- package/dist/src/core/util/log.d.ts +1 -0
- package/dist/src/model/auth.d.ts +6 -0
- package/dist/src/platform_browser/auth_window.d.ts +2 -2
- package/dist/src/platform_browser/recaptcha/recaptcha.d.ts +33 -0
- package/dist/src/platform_browser/recaptcha/recaptcha.test.d.ts +17 -0
- package/dist/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +40 -0
- package/dist/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts +17 -0
- package/dist/src/platform_browser/recaptcha/recaptcha_mock.d.ts +16 -1
- package/dist/src/platform_browser/strategies/popup.d.ts +1 -1
- package/dist/test/helpers/api/helper.d.ts +2 -0
- package/dist/test/helpers/mock_auth.d.ts +5 -0
- package/package.json +6 -6
- package/dist/browser-cjs/index-5859881d.js.map +0 -1
- package/dist/cordova/popup_redirect-3519667a.js.map +0 -1
- package/dist/esm2017/index-680e2b70.js.map +0 -1
- package/dist/esm5/index-714e827f.js.map +0 -1
- package/dist/node/totp-416a2adc.js.map +0 -1
- package/dist/node-esm/totp-c3bf2a20.js.map +0 -1
- package/dist/rn/phone-2ec1815d.js.map +0 -1
package/dist/esm2017/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { A as ActionCodeOperation,
|
|
1
|
+
export { A as ActionCodeOperation, ag as ActionCodeURL, J as AuthCredential, G as AuthErrorCodes, K as EmailAuthCredential, Q as EmailAuthProvider, U as FacebookAuthProvider, F as FactorId, W as GithubAuthProvider, V as GoogleAuthProvider, L as OAuthCredential, X as OAuthProvider, O as OperationType, M as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, Y as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, Z as TwitterAuthProvider, a5 as applyActionCode, w as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a6 as checkActionCode, a4 as confirmPasswordReset, I as connectAuthEmulator, a8 as createUserWithEmailAndPassword, D as debugErrorMap, C as deleteUser, ad as fetchSignInMethodsForEmail, ao as getAdditionalUserInfo, o as getAuth, al as getIdToken, am as getIdTokenResult, aq as getMultiFactorResolver, j as getRedirectResult, N as inMemoryPersistence, i as indexedDBLocalPersistence, H as initializeAuth, t as initializeRecaptchaConfig, ab as isSignInWithEmailLink, a0 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ar as multiFactor, x as onAuthStateChanged, v as onIdTokenChanged, ah as parseActionCodeURL, E as prodErrorMap, a1 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, ap as reload, ae as sendEmailVerification, a3 as sendPasswordResetEmail, aa as sendSignInLinkToEmail, q as setPersistence, _ as signInAnonymously, $ as signInWithCredential, a2 as signInWithCustomToken, a9 as signInWithEmailAndPassword, ac as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, B as signOut, an as unlink, z as updateCurrentUser, aj as updateEmail, ak as updatePassword, u as updatePhoneNumber, ai as updateProfile, y as useDeviceLanguage, af as verifyBeforeUpdateEmail, a7 as verifyPasswordResetCode } from './index-55c8f96e.js';
|
|
2
2
|
import '@firebase/util';
|
|
3
3
|
import '@firebase/app';
|
|
4
|
-
import '@firebase/logger';
|
|
5
4
|
import 'tslib';
|
|
5
|
+
import '@firebase/logger';
|
|
6
6
|
import '@firebase/component';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm2017/internal.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActionCodeOperation,
|
|
1
|
+
import { as as debugAssert, at as _isIOS, au as _isAndroid, av as _fail, aw as _getRedirectUrl, ax as _getProjectConfig, ay as _isIOS7Or8, az as _createError, aA as _assert, aB as AuthEventManager, aC as _getInstance, b as browserLocalPersistence, aD as _persistenceKeyName, a as browserSessionPersistence, aE as _getRedirectResult, aF as _overrideRedirectResult, aG as _clearRedirectOutcomes, aH as _castAuth } from './index-55c8f96e.js';
|
|
2
|
+
export { A as ActionCodeOperation, ag as ActionCodeURL, J as AuthCredential, G as AuthErrorCodes, aJ as AuthImpl, aM as AuthPopup, K as EmailAuthCredential, Q as EmailAuthProvider, U as FacebookAuthProvider, F as FactorId, aN as FetchProvider, W as GithubAuthProvider, V as GoogleAuthProvider, L as OAuthCredential, X as OAuthProvider, O as OperationType, M as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, aO as SAMLAuthCredential, Y as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, Z as TwitterAuthProvider, aI as UserImpl, aA as _assert, aH as _castAuth, av as _fail, aL as _generateEventId, aK as _getClientVersion, aC as _getInstance, aE as _getRedirectResult, aF as _overrideRedirectResult, aD as _persistenceKeyName, a5 as applyActionCode, w as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a6 as checkActionCode, a4 as confirmPasswordReset, I as connectAuthEmulator, a8 as createUserWithEmailAndPassword, D as debugErrorMap, C as deleteUser, ad as fetchSignInMethodsForEmail, ao as getAdditionalUserInfo, o as getAuth, al as getIdToken, am as getIdTokenResult, aq as getMultiFactorResolver, j as getRedirectResult, N as inMemoryPersistence, i as indexedDBLocalPersistence, H as initializeAuth, t as initializeRecaptchaConfig, ab as isSignInWithEmailLink, a0 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, ar as multiFactor, x as onAuthStateChanged, v as onIdTokenChanged, ah as parseActionCodeURL, E as prodErrorMap, a1 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, ap as reload, ae as sendEmailVerification, a3 as sendPasswordResetEmail, aa as sendSignInLinkToEmail, q as setPersistence, _ as signInAnonymously, $ as signInWithCredential, a2 as signInWithCustomToken, a9 as signInWithEmailAndPassword, ac as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, B as signOut, an as unlink, z as updateCurrentUser, aj as updateEmail, ak as updatePassword, u as updatePhoneNumber, ai as updateProfile, y as useDeviceLanguage, af as verifyBeforeUpdateEmail, a7 as verifyPasswordResetCode } from './index-55c8f96e.js';
|
|
3
3
|
import { querystringDecode } from '@firebase/util';
|
|
4
4
|
import '@firebase/app';
|
|
5
|
-
import '@firebase/logger';
|
|
6
5
|
import 'tslib';
|
|
6
|
+
import '@firebase/logger';
|
|
7
7
|
import '@firebase/component';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -15,12 +15,16 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { ActionCodeOperation, Auth } from '../../model/public_types';
|
|
18
|
+
import { RecaptchaClientType, RecaptchaVersion } from '../index';
|
|
18
19
|
import { IdToken, IdTokenResponse } from '../../model/id_token';
|
|
19
20
|
export interface SignInWithPasswordRequest {
|
|
20
21
|
returnSecureToken?: boolean;
|
|
21
22
|
email: string;
|
|
22
23
|
password: string;
|
|
23
24
|
tenantId?: string;
|
|
25
|
+
captchaResponse?: string;
|
|
26
|
+
clientType?: RecaptchaClientType;
|
|
27
|
+
recaptchaVersion?: RecaptchaVersion;
|
|
24
28
|
}
|
|
25
29
|
export interface SignInWithPasswordResponse extends IdTokenResponse {
|
|
26
30
|
email: string;
|
|
@@ -48,10 +52,15 @@ export interface PasswordResetRequest extends GetOobCodeRequest {
|
|
|
48
52
|
requestType: ActionCodeOperation.PASSWORD_RESET;
|
|
49
53
|
email: string;
|
|
50
54
|
captchaResp?: string;
|
|
55
|
+
clientType?: RecaptchaClientType;
|
|
56
|
+
recaptchaVersion?: RecaptchaVersion;
|
|
51
57
|
}
|
|
52
58
|
export interface EmailSignInRequest extends GetOobCodeRequest {
|
|
53
59
|
requestType: ActionCodeOperation.EMAIL_SIGNIN;
|
|
54
60
|
email: string;
|
|
61
|
+
captchaResp?: string;
|
|
62
|
+
clientType?: RecaptchaClientType;
|
|
63
|
+
recaptchaVersion?: RecaptchaVersion;
|
|
55
64
|
}
|
|
56
65
|
export interface VerifyAndChangeEmailRequest extends GetOobCodeRequest {
|
|
57
66
|
requestType: ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL;
|
|
@@ -14,5 +14,21 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { RecaptchaClientType, RecaptchaVersion } from '../index';
|
|
17
18
|
import { Auth } from '../../model/public_types';
|
|
18
19
|
export declare function getRecaptchaParams(auth: Auth): Promise<string>;
|
|
20
|
+
interface GetRecaptchaConfigRequest {
|
|
21
|
+
tenantId?: string;
|
|
22
|
+
clientType?: RecaptchaClientType;
|
|
23
|
+
version?: RecaptchaVersion;
|
|
24
|
+
}
|
|
25
|
+
interface RecaptchaEnforcementState {
|
|
26
|
+
provider: string;
|
|
27
|
+
enforcementState: string;
|
|
28
|
+
}
|
|
29
|
+
export interface GetRecaptchaConfigResponse {
|
|
30
|
+
recaptchaKey: string;
|
|
31
|
+
recaptchaEnforcementState: RecaptchaEnforcementState[];
|
|
32
|
+
}
|
|
33
|
+
export declare function getRecaptchaConfig(auth: Auth, request: GetRecaptchaConfigRequest): Promise<GetRecaptchaConfigResponse>;
|
|
34
|
+
export {};
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { RecaptchaClientType, RecaptchaVersion } from '../index';
|
|
17
18
|
import { IdTokenResponse } from '../../model/id_token';
|
|
18
19
|
import { Auth } from '../../model/public_types';
|
|
19
20
|
export interface SignUpRequest {
|
|
@@ -21,6 +22,9 @@ export interface SignUpRequest {
|
|
|
21
22
|
email?: string;
|
|
22
23
|
password?: string;
|
|
23
24
|
tenantId?: string;
|
|
25
|
+
captchaResponse?: string;
|
|
26
|
+
clientType?: RecaptchaClientType;
|
|
27
|
+
recaptchaVersion?: RecaptchaVersion;
|
|
24
28
|
}
|
|
25
29
|
export interface SignUpResponse extends IdTokenResponse {
|
|
26
30
|
displayName?: string;
|
|
@@ -88,7 +88,15 @@ export declare const enum ServerError {
|
|
|
88
88
|
USER_CANCELLED = "USER_CANCELLED",
|
|
89
89
|
USER_DISABLED = "USER_DISABLED",
|
|
90
90
|
USER_NOT_FOUND = "USER_NOT_FOUND",
|
|
91
|
-
WEAK_PASSWORD = "WEAK_PASSWORD"
|
|
91
|
+
WEAK_PASSWORD = "WEAK_PASSWORD",
|
|
92
|
+
RECAPTCHA_NOT_ENABLED = "RECAPTCHA_NOT_ENABLED",
|
|
93
|
+
MISSING_RECAPTCHA_TOKEN = "MISSING_RECAPTCHA_TOKEN",
|
|
94
|
+
INVALID_RECAPTCHA_TOKEN = "INVALID_RECAPTCHA_TOKEN",
|
|
95
|
+
INVALID_RECAPTCHA_ACTION = "INVALID_RECAPTCHA_ACTION",
|
|
96
|
+
MISSING_CLIENT_TYPE = "MISSING_CLIENT_TYPE",
|
|
97
|
+
MISSING_RECAPTCHA_VERSION = "MISSING_RECAPTCHA_VERSION",
|
|
98
|
+
INVALID_RECAPTCHA_VERSION = "INVALID_RECAPTCHA_VERSION",
|
|
99
|
+
INVALID_REQ_TYPE = "INVALID_REQ_TYPE"
|
|
92
100
|
}
|
|
93
101
|
/**
|
|
94
102
|
* API Response in the event of an error
|
|
@@ -29,7 +29,8 @@ export declare const enum HttpHeader {
|
|
|
29
29
|
X_FIREBASE_LOCALE = "X-Firebase-Locale",
|
|
30
30
|
X_CLIENT_VERSION = "X-Client-Version",
|
|
31
31
|
X_FIREBASE_GMPID = "X-Firebase-gmpid",
|
|
32
|
-
X_FIREBASE_CLIENT = "X-Firebase-Client"
|
|
32
|
+
X_FIREBASE_CLIENT = "X-Firebase-Client",
|
|
33
|
+
X_FIREBASE_APP_CHECK = "X-Firebase-AppCheck"
|
|
33
34
|
}
|
|
34
35
|
export declare const enum Endpoint {
|
|
35
36
|
CREATE_AUTH_URI = "/v1/accounts:createAuthUri",
|
|
@@ -51,7 +52,21 @@ export declare const enum Endpoint {
|
|
|
51
52
|
START_MFA_SIGN_IN = "/v2/accounts/mfaSignIn:start",
|
|
52
53
|
FINALIZE_MFA_SIGN_IN = "/v2/accounts/mfaSignIn:finalize",
|
|
53
54
|
WITHDRAW_MFA = "/v2/accounts/mfaEnrollment:withdraw",
|
|
54
|
-
GET_PROJECT_CONFIG = "/v1/projects"
|
|
55
|
+
GET_PROJECT_CONFIG = "/v1/projects",
|
|
56
|
+
GET_RECAPTCHA_CONFIG = "/v2/recaptchaConfig"
|
|
57
|
+
}
|
|
58
|
+
export declare const enum RecaptchaClientType {
|
|
59
|
+
WEB = "CLIENT_TYPE_WEB",
|
|
60
|
+
ANDROID = "CLIENT_TYPE_ANDROID",
|
|
61
|
+
IOS = "CLIENT_TYPE_IOS"
|
|
62
|
+
}
|
|
63
|
+
export declare const enum RecaptchaVersion {
|
|
64
|
+
ENTERPRISE = "RECAPTCHA_ENTERPRISE"
|
|
65
|
+
}
|
|
66
|
+
export declare const enum RecaptchaActionName {
|
|
67
|
+
SIGN_IN_WITH_PASSWORD = "signInWithPassword",
|
|
68
|
+
GET_OOB_CODE = "getOobCode",
|
|
69
|
+
SIGN_UP_PASSWORD = "signUpPassword"
|
|
55
70
|
}
|
|
56
71
|
export declare const DEFAULT_API_TIMEOUT_MS: Delay;
|
|
57
72
|
export declare function _addTidIfNecessary<T extends {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { _FirebaseService, FirebaseApp } from '@firebase/app';
|
|
18
18
|
import { Provider } from '@firebase/component';
|
|
19
|
+
import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
|
|
19
20
|
import { Auth, AuthErrorMap, AuthSettings, EmulatorConfig, NextOrObserver, Persistence, PopupRedirectResolver, User, CompleteFn, ErrorFn, Unsubscribe } from '../../model/public_types';
|
|
20
21
|
import { ErrorFactory } from '@firebase/util';
|
|
21
22
|
import { AuthInternal, ConfigInternal } from '../../model/auth';
|
|
@@ -23,6 +24,7 @@ import { PopupRedirectResolverInternal } from '../../model/popup_redirect';
|
|
|
23
24
|
import { UserInternal } from '../../model/user';
|
|
24
25
|
import { AuthErrorCode, AuthErrorParams } from '../errors';
|
|
25
26
|
import { PersistenceInternal } from '../persistence';
|
|
27
|
+
import { RecaptchaConfig } from '../../platform_browser/recaptcha/recaptcha';
|
|
26
28
|
export declare const enum DefaultConfig {
|
|
27
29
|
TOKEN_API_HOST = "securetoken.googleapis.com",
|
|
28
30
|
API_HOST = "identitytoolkit.googleapis.com",
|
|
@@ -31,6 +33,7 @@ export declare const enum DefaultConfig {
|
|
|
31
33
|
export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
32
34
|
readonly app: FirebaseApp;
|
|
33
35
|
private readonly heartbeatServiceProvider;
|
|
36
|
+
private readonly appCheckServiceProvider;
|
|
34
37
|
readonly config: ConfigInternal;
|
|
35
38
|
currentUser: User | null;
|
|
36
39
|
emulatorConfig: EmulatorConfig | null;
|
|
@@ -48,12 +51,14 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
|
48
51
|
_initializationPromise: Promise<void> | null;
|
|
49
52
|
_popupRedirectResolver: PopupRedirectResolverInternal | null;
|
|
50
53
|
_errorFactory: ErrorFactory<AuthErrorCode, AuthErrorParams>;
|
|
54
|
+
_agentRecaptchaConfig: RecaptchaConfig | null;
|
|
55
|
+
_tenantRecaptchaConfigs: Record<string, RecaptchaConfig>;
|
|
51
56
|
readonly name: string;
|
|
52
57
|
private lastNotifiedUid;
|
|
53
58
|
languageCode: string | null;
|
|
54
59
|
tenantId: string | null;
|
|
55
60
|
settings: AuthSettings;
|
|
56
|
-
constructor(app: FirebaseApp, heartbeatServiceProvider: Provider<'heartbeat'>, config: ConfigInternal);
|
|
61
|
+
constructor(app: FirebaseApp, heartbeatServiceProvider: Provider<'heartbeat'>, appCheckServiceProvider: Provider<AppCheckInternalComponentName>, config: ConfigInternal);
|
|
57
62
|
_initializeWithPersistence(persistenceHierarchy: PersistenceInternal[], popupRedirectResolver?: PopupRedirectResolver): Promise<void>;
|
|
58
63
|
/**
|
|
59
64
|
* If the persistence is changed in another window, the user manager will let us know
|
|
@@ -68,6 +73,8 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
|
68
73
|
_updateCurrentUser(user: User | null, skipBeforeStateCallbacks?: boolean): Promise<void>;
|
|
69
74
|
signOut(): Promise<void>;
|
|
70
75
|
setPersistence(persistence: Persistence): Promise<void>;
|
|
76
|
+
initializeRecaptchaConfig(): Promise<void>;
|
|
77
|
+
_getRecaptchaConfig(): RecaptchaConfig | null;
|
|
71
78
|
_getPersistence(): string;
|
|
72
79
|
_updateErrorMap(errorMap: AuthErrorMap): void;
|
|
73
80
|
onAuthStateChanged(nextOrObserver: NextOrObserver<User>, error?: ErrorFn, completed?: CompleteFn): Unsubscribe;
|
|
@@ -100,6 +107,7 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
|
100
107
|
_logFramework(framework: string): void;
|
|
101
108
|
_getFrameworks(): readonly string[];
|
|
102
109
|
_getAdditionalHeaders(): Promise<Record<string, string>>;
|
|
110
|
+
_getAppCheckToken(): Promise<string | undefined>;
|
|
103
111
|
}
|
|
104
112
|
/**
|
|
105
113
|
* Method to be used to cast down to our private implmentation of Auth.
|
|
@@ -121,7 +121,15 @@ export declare const enum AuthErrorCode {
|
|
|
121
121
|
USER_SIGNED_OUT = "user-signed-out",
|
|
122
122
|
WEAK_PASSWORD = "weak-password",
|
|
123
123
|
WEB_STORAGE_UNSUPPORTED = "web-storage-unsupported",
|
|
124
|
-
ALREADY_INITIALIZED = "already-initialized"
|
|
124
|
+
ALREADY_INITIALIZED = "already-initialized",
|
|
125
|
+
RECAPTCHA_NOT_ENABLED = "recaptcha-not-enabled",
|
|
126
|
+
MISSING_RECAPTCHA_TOKEN = "missing-recaptcha-token",
|
|
127
|
+
INVALID_RECAPTCHA_TOKEN = "invalid-recaptcha-token",
|
|
128
|
+
INVALID_RECAPTCHA_ACTION = "invalid-recaptcha-action",
|
|
129
|
+
MISSING_CLIENT_TYPE = "missing-client-type",
|
|
130
|
+
MISSING_RECAPTCHA_VERSION = "missing-recaptcha-version",
|
|
131
|
+
INVALID_RECAPTCHA_VERSION = "invalid-recaptcha-version",
|
|
132
|
+
INVALID_REQ_TYPE = "invalid-req-type"
|
|
125
133
|
}
|
|
126
134
|
export interface ErrorMapRetriever extends AuthErrorMap {
|
|
127
135
|
(): ErrorMap<AuthErrorCode>;
|
|
@@ -302,5 +310,13 @@ export declare const AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY: {
|
|
|
302
310
|
readonly WEAK_PASSWORD: "auth/weak-password";
|
|
303
311
|
readonly WEB_STORAGE_UNSUPPORTED: "auth/web-storage-unsupported";
|
|
304
312
|
readonly ALREADY_INITIALIZED: "auth/already-initialized";
|
|
313
|
+
readonly RECAPTCHA_NOT_ENABLED: "auth/recaptcha-not-enabled";
|
|
314
|
+
readonly MISSING_RECAPTCHA_TOKEN: "auth/missing-recaptcha-token";
|
|
315
|
+
readonly INVALID_RECAPTCHA_TOKEN: "auth/invalid-recaptcha-token";
|
|
316
|
+
readonly INVALID_RECAPTCHA_ACTION: "auth/invalid-recaptcha-action";
|
|
317
|
+
readonly MISSING_CLIENT_TYPE: "auth/missing-client-type";
|
|
318
|
+
readonly MISSING_RECAPTCHA_VERSION: "auth/missing-recaptcha-version";
|
|
319
|
+
readonly INVALID_RECAPTCHA_VERSION: "auth/invalid-recaptcha-version";
|
|
320
|
+
readonly INVALID_REQ_TYPE: "auth/invalid-req-type";
|
|
305
321
|
};
|
|
306
322
|
export {};
|
|
@@ -38,6 +38,32 @@ export { debugErrorMap, prodErrorMap, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY
|
|
|
38
38
|
* @public
|
|
39
39
|
*/
|
|
40
40
|
export declare function setPersistence(auth: Auth, persistence: Persistence): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Loads the reCAPTCHA configuration into the `Auth` instance.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This will load the reCAPTCHA config, which indicates whether the reCAPTCHA
|
|
46
|
+
* verification flow should be triggered for each auth provider, into the
|
|
47
|
+
* current Auth session.
|
|
48
|
+
*
|
|
49
|
+
* If initializeRecaptchaConfig() is not invoked, the auth flow will always start
|
|
50
|
+
* without reCAPTCHA verification. If the provider is configured to require reCAPTCHA
|
|
51
|
+
* verification, the SDK will transparently load the reCAPTCHA config and restart the
|
|
52
|
+
* auth flows.
|
|
53
|
+
*
|
|
54
|
+
* Thus, by calling this optional method, you will reduce the latency of future auth flows.
|
|
55
|
+
* Loading the reCAPTCHA config early will also enhance the signal collected by reCAPTCHA.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```javascript
|
|
59
|
+
* initializeRecaptchaConfig(auth);
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @param auth - The {@link Auth} instance.
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export declare function initializeRecaptchaConfig(auth: Auth): Promise<void>;
|
|
41
67
|
/**
|
|
42
68
|
* Adds an observer for changes to the signed-in user's ID token.
|
|
43
69
|
*
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
import { AuthProvider } from '../../model/public_types';
|
|
18
18
|
import { AuthInternal } from '../../model/auth';
|
|
19
19
|
import { AuthEventType } from '../../model/popup_redirect';
|
|
20
|
-
export declare function _getRedirectUrl(auth: AuthInternal, provider: AuthProvider, authType: AuthEventType, redirectUrl?: string, eventId?: string, additionalParams?: Record<string, string>): string
|
|
20
|
+
export declare function _getRedirectUrl(auth: AuthInternal, provider: AuthProvider, authType: AuthEventType, redirectUrl?: string, eventId?: string, additionalParams?: Record<string, string>): Promise<string>;
|
|
@@ -19,4 +19,5 @@ export { LogLevel };
|
|
|
19
19
|
export declare function _getLogLevel(): LogLevel;
|
|
20
20
|
export declare function _setLogLevel(newLevel: LogLevel): void;
|
|
21
21
|
export declare function _logDebug(msg: string, ...args: string[]): void;
|
|
22
|
+
export declare function _logWarn(msg: string, ...args: string[]): void;
|
|
22
23
|
export declare function _logError(msg: string, ...args: string[]): void;
|
|
@@ -20,6 +20,7 @@ import { AuthErrorCode, AuthErrorParams } from '../core/errors';
|
|
|
20
20
|
import { PopupRedirectResolverInternal } from './popup_redirect';
|
|
21
21
|
import { UserInternal } from './user';
|
|
22
22
|
import { ClientPlatform } from '../core/util/version';
|
|
23
|
+
import { RecaptchaConfig } from '../platform_browser/recaptcha/recaptcha';
|
|
23
24
|
export declare type AppName = string;
|
|
24
25
|
export declare type ApiKey = string;
|
|
25
26
|
export declare type AuthDomain = string;
|
|
@@ -47,6 +48,8 @@ export interface ConfigInternal extends Config {
|
|
|
47
48
|
export interface AuthInternal extends Auth {
|
|
48
49
|
currentUser: User | null;
|
|
49
50
|
emulatorConfig: EmulatorConfig | null;
|
|
51
|
+
_agentRecaptchaConfig: RecaptchaConfig | null;
|
|
52
|
+
_tenantRecaptchaConfigs: Record<string, RecaptchaConfig>;
|
|
50
53
|
_canInitEmulator: boolean;
|
|
51
54
|
_isInitialized: boolean;
|
|
52
55
|
_initializationPromise: Promise<void> | null;
|
|
@@ -61,9 +64,11 @@ export interface AuthInternal extends Auth {
|
|
|
61
64
|
_startProactiveRefresh(): void;
|
|
62
65
|
_stopProactiveRefresh(): void;
|
|
63
66
|
_getPersistence(): string;
|
|
67
|
+
_getRecaptchaConfig(): RecaptchaConfig | null;
|
|
64
68
|
_logFramework(framework: string): void;
|
|
65
69
|
_getFrameworks(): readonly string[];
|
|
66
70
|
_getAdditionalHeaders(): Promise<Record<string, string>>;
|
|
71
|
+
_getAppCheckToken(): Promise<string | undefined>;
|
|
67
72
|
readonly name: AppName;
|
|
68
73
|
readonly config: ConfigInternal;
|
|
69
74
|
languageCode: string | null;
|
|
@@ -72,4 +77,5 @@ export interface AuthInternal extends Auth {
|
|
|
72
77
|
_errorFactory: ErrorFactory<AuthErrorCode, AuthErrorParams>;
|
|
73
78
|
useDeviceLanguage(): void;
|
|
74
79
|
signOut(): Promise<void>;
|
|
80
|
+
initializeRecaptchaConfig(): Promise<void>;
|
|
75
81
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { Recaptcha } from './recaptcha/recaptcha';
|
|
17
|
+
import { Recaptcha, GreCAPTCHATopLevel } from './recaptcha/recaptcha';
|
|
18
18
|
/**
|
|
19
19
|
* A specialized window type that melds the normal window type plus the
|
|
20
20
|
* various bits we need. The three different blocks that are &'d together
|
|
@@ -23,7 +23,7 @@ import { Recaptcha } from './recaptcha/recaptcha';
|
|
|
23
23
|
export declare type AuthWindow = {
|
|
24
24
|
[T in keyof Window]: Window[T];
|
|
25
25
|
} & {
|
|
26
|
-
grecaptcha?: Recaptcha;
|
|
26
|
+
grecaptcha?: Recaptcha | GreCAPTCHATopLevel;
|
|
27
27
|
___jsl?: Record<string, any>;
|
|
28
28
|
gapi?: typeof gapi;
|
|
29
29
|
} & {
|
|
@@ -15,9 +15,42 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { RecaptchaParameters } from '../../model/public_types';
|
|
18
|
+
import { GetRecaptchaConfigResponse } from '../../api/authentication/recaptcha';
|
|
18
19
|
export interface Recaptcha {
|
|
19
20
|
render: (container: HTMLElement, parameters: RecaptchaParameters) => number;
|
|
20
21
|
getResponse: (id: number) => string;
|
|
21
22
|
execute: (id: number) => unknown;
|
|
22
23
|
reset: (id: number) => unknown;
|
|
23
24
|
}
|
|
25
|
+
export declare function isV2(grecaptcha: Recaptcha | GreCAPTCHA | undefined): grecaptcha is Recaptcha;
|
|
26
|
+
export interface GreCAPTCHATopLevel extends GreCAPTCHA {
|
|
27
|
+
enterprise: GreCAPTCHA;
|
|
28
|
+
}
|
|
29
|
+
export interface GreCAPTCHA {
|
|
30
|
+
ready: (callback: () => void) => void;
|
|
31
|
+
execute: (siteKey: string, options: {
|
|
32
|
+
action: string;
|
|
33
|
+
}) => Promise<string>;
|
|
34
|
+
render: (container: string | HTMLElement, parameters: GreCAPTCHARenderOption) => string;
|
|
35
|
+
}
|
|
36
|
+
export interface GreCAPTCHARenderOption {
|
|
37
|
+
sitekey: string;
|
|
38
|
+
size: 'invisible';
|
|
39
|
+
}
|
|
40
|
+
export declare function isEnterprise(grecaptcha: Recaptcha | GreCAPTCHA | undefined): grecaptcha is GreCAPTCHATopLevel;
|
|
41
|
+
declare global {
|
|
42
|
+
interface Window {
|
|
43
|
+
grecaptcha?: Recaptcha | GreCAPTCHATopLevel;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export declare class RecaptchaConfig {
|
|
47
|
+
/**
|
|
48
|
+
* The reCAPTCHA site key.
|
|
49
|
+
*/
|
|
50
|
+
siteKey: string;
|
|
51
|
+
/**
|
|
52
|
+
* The reCAPTCHA enablement status of the {@link EmailAuthProvider} for the current tenant.
|
|
53
|
+
*/
|
|
54
|
+
emailPasswordEnabled: boolean;
|
|
55
|
+
constructor(response: GetRecaptchaConfigResponse);
|
|
56
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 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,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 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 { RecaptchaActionName } from '../../api';
|
|
18
|
+
import { Auth } from '../../model/public_types';
|
|
19
|
+
import { AuthInternal } from '../../model/auth';
|
|
20
|
+
export declare const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = "recaptcha-enterprise";
|
|
21
|
+
export declare class RecaptchaEnterpriseVerifier {
|
|
22
|
+
/**
|
|
23
|
+
* Identifies the type of application verifier (e.g. "recaptcha-enterprise").
|
|
24
|
+
*/
|
|
25
|
+
readonly type = "recaptcha-enterprise";
|
|
26
|
+
private readonly auth;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param authExtern - The corresponding Firebase {@link Auth} instance.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
constructor(authExtern: Auth);
|
|
33
|
+
/**
|
|
34
|
+
* Executes the verification process.
|
|
35
|
+
*
|
|
36
|
+
* @returns A Promise for a token that can be used to assert the validity of a request.
|
|
37
|
+
*/
|
|
38
|
+
verify(action?: string, forceRefresh?: boolean): Promise<string>;
|
|
39
|
+
}
|
|
40
|
+
export declare function injectRecaptchaFields<T>(auth: AuthInternal, request: T, action: RecaptchaActionName, captchaResp?: boolean): Promise<T>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 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 {};
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { AuthInternal } from '../../model/auth';
|
|
18
18
|
import { RecaptchaParameters } from '../../model/public_types';
|
|
19
|
-
import { Recaptcha } from './recaptcha';
|
|
19
|
+
import { Recaptcha, GreCAPTCHATopLevel, GreCAPTCHARenderOption, GreCAPTCHA } from './recaptcha';
|
|
20
20
|
export declare const _SOLVE_TIME_MS = 500;
|
|
21
21
|
export declare const _EXPIRATION_TIME_MS = 60000;
|
|
22
22
|
export declare const _WIDGET_ID_START = 1000000000000;
|
|
@@ -35,6 +35,21 @@ export declare class MockReCaptcha implements Recaptcha {
|
|
|
35
35
|
getResponse(optWidgetId?: number): string;
|
|
36
36
|
execute(optWidgetId?: number | string): Promise<string>;
|
|
37
37
|
}
|
|
38
|
+
export declare class MockGreCAPTCHATopLevel implements GreCAPTCHATopLevel {
|
|
39
|
+
enterprise: GreCAPTCHA;
|
|
40
|
+
ready(callback: () => void): void;
|
|
41
|
+
execute(_siteKey: string, _options: {
|
|
42
|
+
action: string;
|
|
43
|
+
}): Promise<string>;
|
|
44
|
+
render(_container: string | HTMLElement, _parameters: GreCAPTCHARenderOption): string;
|
|
45
|
+
}
|
|
46
|
+
export declare class MockGreCAPTCHA implements GreCAPTCHA {
|
|
47
|
+
ready(callback: () => void): void;
|
|
48
|
+
execute(_siteKey: string, _options: {
|
|
49
|
+
action: string;
|
|
50
|
+
}): Promise<string>;
|
|
51
|
+
render(_container: string | HTMLElement, _parameters: GreCAPTCHARenderOption): string;
|
|
52
|
+
}
|
|
38
53
|
export declare class MockWidget {
|
|
39
54
|
private readonly params;
|
|
40
55
|
private readonly container;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { Auth, AuthProvider, PopupRedirectResolver, User, UserCredential } from '../../model/public_types';
|
|
18
18
|
import { Delay } from '../../core/util/delay';
|
|
19
19
|
export declare const enum _Timeout {
|
|
20
|
-
AUTH_EVENT =
|
|
20
|
+
AUTH_EVENT = 8000
|
|
21
21
|
}
|
|
22
22
|
export declare const _POLL_WINDOW_CLOSE_TIMEOUT: Delay;
|
|
23
23
|
/**
|
|
@@ -17,4 +17,6 @@
|
|
|
17
17
|
import { Endpoint } from '../../../src/api';
|
|
18
18
|
import { Route } from '../mock_fetch';
|
|
19
19
|
export declare function endpointUrl(endpoint: Endpoint): string;
|
|
20
|
+
export declare function endpointUrlWithParams(endpoint: Endpoint, params: Record<string, any>): string;
|
|
20
21
|
export declare function mockEndpoint(endpoint: Endpoint, response: object, status?: number): Route;
|
|
22
|
+
export declare function mockEndpointWithParams(endpoint: Endpoint, params: Record<string, any>, response: object, status?: number): Route;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { Provider } from '@firebase/component';
|
|
18
|
+
import { AppCheckTokenResult } from '@firebase/app-check-interop-types';
|
|
18
19
|
import { PopupRedirectResolver } from '../../src/model/public_types';
|
|
19
20
|
import { AuthImpl } from '../../src/core/auth/auth_impl';
|
|
20
21
|
import { PersistedBlob } from '../../src/core/persistence';
|
|
@@ -33,6 +34,10 @@ export declare const FAKE_HEARTBEAT_CONTROLLER: {
|
|
|
33
34
|
getHeartbeatsHeader: () => Promise<string>;
|
|
34
35
|
};
|
|
35
36
|
export declare const FAKE_HEARTBEAT_CONTROLLER_PROVIDER: Provider<'heartbeat'>;
|
|
37
|
+
export declare const FAKE_APP_CHECK_CONTROLLER: {
|
|
38
|
+
getToken: () => Promise<AppCheckTokenResult>;
|
|
39
|
+
};
|
|
40
|
+
export declare const FAKE_APP_CHECK_CONTROLLER_PROVIDER: Provider<'app-check-internal'>;
|
|
36
41
|
export declare class MockPersistenceLayer extends InMemoryPersistence {
|
|
37
42
|
lastObjectSet: PersistedBlob | null;
|
|
38
43
|
_set(key: string, object: PersistedBlob): Promise<void>;
|