@firebase/auth 1.3.0-canary.60e4a07d2 → 1.3.0-canary.68927ced1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-public.d.ts +25 -4
- package/dist/auth.d.ts +25 -4
- package/dist/browser-cjs/{index-9e6c4f37.js → index-afd62403.js} +115 -127
- package/dist/browser-cjs/index-afd62403.js.map +1 -0
- package/dist/browser-cjs/index.js +1 -1
- package/dist/browser-cjs/internal.js +1 -1
- package/dist/browser-cjs/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/browser-cjs/src/api/index.d.ts +10 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +2 -2
- package/dist/cordova/{popup_redirect-4758cdae.js → popup_redirect-9b88d2b1.js} +165 -214
- package/dist/cordova/popup_redirect-9b88d2b1.js.map +1 -0
- package/dist/cordova/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/cordova/src/api/index.d.ts +10 -0
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/esm2017/{index-c088af8a.js → index-cec40fec.js} +115 -127
- package/dist/esm2017/index-cec40fec.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/esm2017/src/api/index.d.ts +10 -0
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/esm5/{index-f6b0662a.js → index-ebd5dc65.js} +165 -214
- package/dist/esm5/index-ebd5dc65.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/esm5/src/api/index.d.ts +10 -0
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/index.webworker.esm5.js +123 -172
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/node/src/api/index.d.ts +10 -0
- package/dist/node/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/node/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/node/{totp-2cc6b74c.js → totp-e959574a.js} +161 -210
- package/dist/node/totp-e959574a.js.map +1 -0
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/node-esm/src/api/index.d.ts +10 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/node-esm/{totp-bfa3ee61.js → totp-63ae0bb5.js} +111 -123
- package/dist/node-esm/totp-63ae0bb5.js.map +1 -0
- package/dist/rn/{index-6ea1dd0a.js → index-c0b92f3e.js} +165 -214
- package/dist/rn/index-c0b92f3e.js.map +1 -0
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +1 -1
- package/dist/rn/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/rn/src/api/index.d.ts +10 -0
- package/dist/rn/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/rn/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/src/api/index.d.ts +10 -0
- package/dist/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/package.json +12 -12
- package/dist/browser-cjs/index-9e6c4f37.js.map +0 -1
- package/dist/cordova/popup_redirect-4758cdae.js.map +0 -1
- package/dist/esm2017/index-c088af8a.js.map +0 -1
- package/dist/esm5/index-f6b0662a.js.map +0 -1
- package/dist/node/totp-2cc6b74c.js.map +0 -1
- package/dist/node-esm/totp-bfa3ee61.js.map +0 -1
- package/dist/rn/index-6ea1dd0a.js.map +0 -1
package/dist/esm2017/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ActionCodeOperation, ah as ActionCodeURL, K as AuthCredential, H as AuthErrorCodes, L as EmailAuthCredential, U as EmailAuthProvider, V as FacebookAuthProvider, F as FactorId, X as GithubAuthProvider, W as GoogleAuthProvider, M as OAuthCredential, Y as OAuthProvider, O as OperationType, N as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, Z as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, _ as TwitterAuthProvider, a6 as applyActionCode, x as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a7 as checkActionCode, a5 as confirmPasswordReset, J as connectAuthEmulator, a9 as createUserWithEmailAndPassword, E as debugErrorMap, D as deleteUser, ae as fetchSignInMethodsForEmail, ap as getAdditionalUserInfo, o as getAuth, am as getIdToken, an as getIdTokenResult, ar as getMultiFactorResolver, j as getRedirectResult, Q as inMemoryPersistence, i as indexedDBLocalPersistence, I as initializeAuth, t as initializeRecaptchaConfig, ac as isSignInWithEmailLink, a1 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, as as multiFactor, y as onAuthStateChanged, w as onIdTokenChanged, ai as parseActionCodeURL, G as prodErrorMap, a2 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, aq as reload, af as sendEmailVerification, a4 as sendPasswordResetEmail, ab as sendSignInLinkToEmail, q as setPersistence, $ as signInAnonymously, a0 as signInWithCredential, a3 as signInWithCustomToken, aa as signInWithEmailAndPassword, ad as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, C as signOut, ao as unlink, B as updateCurrentUser, ak as updateEmail, al as updatePassword, u as updatePhoneNumber, aj as updateProfile, z as useDeviceLanguage, v as validatePassword, ag as verifyBeforeUpdateEmail, a8 as verifyPasswordResetCode } from './index-
|
|
1
|
+
export { A as ActionCodeOperation, ah as ActionCodeURL, K as AuthCredential, H as AuthErrorCodes, L as EmailAuthCredential, U as EmailAuthProvider, V as FacebookAuthProvider, F as FactorId, X as GithubAuthProvider, W as GoogleAuthProvider, M as OAuthCredential, Y as OAuthProvider, O as OperationType, N as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, Z as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, _ as TwitterAuthProvider, a6 as applyActionCode, x as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a7 as checkActionCode, a5 as confirmPasswordReset, J as connectAuthEmulator, a9 as createUserWithEmailAndPassword, E as debugErrorMap, D as deleteUser, ae as fetchSignInMethodsForEmail, ap as getAdditionalUserInfo, o as getAuth, am as getIdToken, an as getIdTokenResult, ar as getMultiFactorResolver, j as getRedirectResult, Q as inMemoryPersistence, i as indexedDBLocalPersistence, I as initializeAuth, t as initializeRecaptchaConfig, ac as isSignInWithEmailLink, a1 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, as as multiFactor, y as onAuthStateChanged, w as onIdTokenChanged, ai as parseActionCodeURL, G as prodErrorMap, a2 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, aq as reload, af as sendEmailVerification, a4 as sendPasswordResetEmail, ab as sendSignInLinkToEmail, q as setPersistence, $ as signInAnonymously, a0 as signInWithCredential, a3 as signInWithCustomToken, aa as signInWithEmailAndPassword, ad as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, C as signOut, ao as unlink, B as updateCurrentUser, ak as updateEmail, al as updatePassword, u as updatePhoneNumber, aj as updateProfile, z as useDeviceLanguage, v as validatePassword, ag as verifyBeforeUpdateEmail, a8 as verifyPasswordResetCode } from './index-cec40fec.js';
|
|
2
2
|
import '@firebase/util';
|
|
3
3
|
import '@firebase/app';
|
|
4
4
|
import '@firebase/logger';
|
package/dist/esm2017/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { at as debugAssert, au as _isIOS, av as _isAndroid, aw as _fail, ax as _getRedirectUrl, ay as _getProjectConfig, az as _isIOS7Or8, aA as _createError, aB as _assert, aC as AuthEventManager, aD as _getInstance, b as browserLocalPersistence, aE as _persistenceKeyName, a as browserSessionPersistence, aF as _getRedirectResult, aG as _overrideRedirectResult, aH as _clearRedirectOutcomes, aI as _castAuth } from './index-
|
|
2
|
-
export { A as ActionCodeOperation, ah as ActionCodeURL, K as AuthCredential, H as AuthErrorCodes, aK as AuthImpl, aN as AuthPopup, L as EmailAuthCredential, U as EmailAuthProvider, V as FacebookAuthProvider, F as FactorId, aO as FetchProvider, X as GithubAuthProvider, W as GoogleAuthProvider, M as OAuthCredential, Y as OAuthProvider, O as OperationType, N as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, aP as SAMLAuthCredential, Z as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, _ as TwitterAuthProvider, aJ as UserImpl, aB as _assert, aI as _castAuth, aw as _fail, aM as _generateEventId, aL as _getClientVersion, aD as _getInstance, aF as _getRedirectResult, aG as _overrideRedirectResult, aE as _persistenceKeyName, a6 as applyActionCode, x as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a7 as checkActionCode, a5 as confirmPasswordReset, J as connectAuthEmulator, a9 as createUserWithEmailAndPassword, E as debugErrorMap, D as deleteUser, ae as fetchSignInMethodsForEmail, ap as getAdditionalUserInfo, o as getAuth, am as getIdToken, an as getIdTokenResult, ar as getMultiFactorResolver, j as getRedirectResult, Q as inMemoryPersistence, i as indexedDBLocalPersistence, I as initializeAuth, t as initializeRecaptchaConfig, ac as isSignInWithEmailLink, a1 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, as as multiFactor, y as onAuthStateChanged, w as onIdTokenChanged, ai as parseActionCodeURL, G as prodErrorMap, a2 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, aq as reload, af as sendEmailVerification, a4 as sendPasswordResetEmail, ab as sendSignInLinkToEmail, q as setPersistence, $ as signInAnonymously, a0 as signInWithCredential, a3 as signInWithCustomToken, aa as signInWithEmailAndPassword, ad as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, C as signOut, ao as unlink, B as updateCurrentUser, ak as updateEmail, al as updatePassword, u as updatePhoneNumber, aj as updateProfile, z as useDeviceLanguage, v as validatePassword, ag as verifyBeforeUpdateEmail, a8 as verifyPasswordResetCode } from './index-
|
|
1
|
+
import { at as debugAssert, au as _isIOS, av as _isAndroid, aw as _fail, ax as _getRedirectUrl, ay as _getProjectConfig, az as _isIOS7Or8, aA as _createError, aB as _assert, aC as AuthEventManager, aD as _getInstance, b as browserLocalPersistence, aE as _persistenceKeyName, a as browserSessionPersistence, aF as _getRedirectResult, aG as _overrideRedirectResult, aH as _clearRedirectOutcomes, aI as _castAuth } from './index-cec40fec.js';
|
|
2
|
+
export { A as ActionCodeOperation, ah as ActionCodeURL, K as AuthCredential, H as AuthErrorCodes, aK as AuthImpl, aN as AuthPopup, L as EmailAuthCredential, U as EmailAuthProvider, V as FacebookAuthProvider, F as FactorId, aO as FetchProvider, X as GithubAuthProvider, W as GoogleAuthProvider, M as OAuthCredential, Y as OAuthProvider, O as OperationType, N as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, aP as SAMLAuthCredential, Z as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, _ as TwitterAuthProvider, aJ as UserImpl, aB as _assert, aI as _castAuth, aw as _fail, aM as _generateEventId, aL as _getClientVersion, aD as _getInstance, aF as _getRedirectResult, aG as _overrideRedirectResult, aE as _persistenceKeyName, a6 as applyActionCode, x as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a7 as checkActionCode, a5 as confirmPasswordReset, J as connectAuthEmulator, a9 as createUserWithEmailAndPassword, E as debugErrorMap, D as deleteUser, ae as fetchSignInMethodsForEmail, ap as getAdditionalUserInfo, o as getAuth, am as getIdToken, an as getIdTokenResult, ar as getMultiFactorResolver, j as getRedirectResult, Q as inMemoryPersistence, i as indexedDBLocalPersistence, I as initializeAuth, t as initializeRecaptchaConfig, ac as isSignInWithEmailLink, a1 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, as as multiFactor, y as onAuthStateChanged, w as onIdTokenChanged, ai as parseActionCodeURL, G as prodErrorMap, a2 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, aq as reload, af as sendEmailVerification, a4 as sendPasswordResetEmail, ab as sendSignInLinkToEmail, q as setPersistence, $ as signInAnonymously, a0 as signInWithCredential, a3 as signInWithCustomToken, aa as signInWithEmailAndPassword, ad as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, C as signOut, ao as unlink, B as updateCurrentUser, ak as updateEmail, al as updatePassword, u as updatePhoneNumber, aj as updateProfile, z as useDeviceLanguage, v as validatePassword, ag as verifyBeforeUpdateEmail, a8 as verifyPasswordResetCode } from './index-cec40fec.js';
|
|
3
3
|
import { querystringDecode } from '@firebase/util';
|
|
4
4
|
import '@firebase/app';
|
|
5
5
|
import '@firebase/logger';
|
|
@@ -22,13 +22,13 @@ interface GetRecaptchaConfigRequest {
|
|
|
22
22
|
clientType?: RecaptchaClientType;
|
|
23
23
|
version?: RecaptchaVersion;
|
|
24
24
|
}
|
|
25
|
-
interface
|
|
25
|
+
export interface RecaptchaEnforcementProviderState {
|
|
26
26
|
provider: string;
|
|
27
27
|
enforcementState: string;
|
|
28
28
|
}
|
|
29
29
|
export interface GetRecaptchaConfigResponse {
|
|
30
30
|
recaptchaKey: string;
|
|
31
|
-
recaptchaEnforcementState:
|
|
31
|
+
recaptchaEnforcementState: RecaptchaEnforcementProviderState[];
|
|
32
32
|
}
|
|
33
33
|
export declare function getRecaptchaConfig(auth: Auth, request: GetRecaptchaConfigRequest): Promise<GetRecaptchaConfigResponse>;
|
|
34
34
|
export {};
|
|
@@ -69,6 +69,15 @@ export declare const enum RecaptchaActionName {
|
|
|
69
69
|
GET_OOB_CODE = "getOobCode",
|
|
70
70
|
SIGN_UP_PASSWORD = "signUpPassword"
|
|
71
71
|
}
|
|
72
|
+
export declare const enum EnforcementState {
|
|
73
|
+
ENFORCE = "ENFORCE",
|
|
74
|
+
AUDIT = "AUDIT",
|
|
75
|
+
OFF = "OFF",
|
|
76
|
+
ENFORCEMENT_STATE_UNSPECIFIED = "ENFORCEMENT_STATE_UNSPECIFIED"
|
|
77
|
+
}
|
|
78
|
+
export declare const enum RecaptchaProvider {
|
|
79
|
+
EMAIL_PASSWORD_PROVIDER = "EMAIL_PASSWORD_PROVIDER"
|
|
80
|
+
}
|
|
72
81
|
export declare const DEFAULT_API_TIMEOUT_MS: Delay;
|
|
73
82
|
export declare function _addTidIfNecessary<T extends {
|
|
74
83
|
tenantId?: string;
|
|
@@ -77,6 +86,7 @@ export declare function _performApiRequest<T, V>(auth: Auth, method: HttpMethod,
|
|
|
77
86
|
export declare function _performFetchWithErrorHandling<V>(auth: Auth, customErrorMap: Partial<ServerErrorMap<ServerError>>, fetchFn: () => Promise<Response>): Promise<V>;
|
|
78
87
|
export declare function _performSignInRequest<T, V extends IdTokenResponse>(auth: Auth, method: HttpMethod, path: Endpoint, request?: T, customErrorMap?: Partial<ServerErrorMap<ServerError>>): Promise<V>;
|
|
79
88
|
export declare function _getFinalTarget(auth: Auth, host: string, path: string, query: string): string;
|
|
89
|
+
export declare function _parseEnforcementState(enforcementStateStr: string): EnforcementState;
|
|
80
90
|
interface PotentialResponse extends IdTokenResponse {
|
|
81
91
|
email?: string;
|
|
82
92
|
phoneNumber?: string;
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { RecaptchaParameters } from '../../model/public_types';
|
|
18
|
-
import { GetRecaptchaConfigResponse } from '../../api/authentication/recaptcha';
|
|
18
|
+
import { GetRecaptchaConfigResponse, RecaptchaEnforcementProviderState } from '../../api/authentication/recaptcha';
|
|
19
|
+
import { EnforcementState } from '../../api/index';
|
|
19
20
|
export interface Recaptcha {
|
|
20
21
|
render: (container: HTMLElement, parameters: RecaptchaParameters) => number;
|
|
21
22
|
getResponse: (id: number) => string;
|
|
@@ -49,8 +50,22 @@ export declare class RecaptchaConfig {
|
|
|
49
50
|
*/
|
|
50
51
|
siteKey: string;
|
|
51
52
|
/**
|
|
52
|
-
* The
|
|
53
|
+
* The list of providers and their enablement status for reCAPTCHA Enterprise.
|
|
53
54
|
*/
|
|
54
|
-
|
|
55
|
+
recaptchaEnforcementState: RecaptchaEnforcementProviderState[];
|
|
55
56
|
constructor(response: GetRecaptchaConfigResponse);
|
|
57
|
+
/**
|
|
58
|
+
* Returns the reCAPTCHA Enterprise enforcement state for the given provider.
|
|
59
|
+
*
|
|
60
|
+
* @param providerStr - The provider whose enforcement state is to be returned.
|
|
61
|
+
* @returns The reCAPTCHA Enterprise enforcement state for the given provider.
|
|
62
|
+
*/
|
|
63
|
+
getProviderEnforcementState(providerStr: string): EnforcementState | null;
|
|
64
|
+
/**
|
|
65
|
+
* Returns true if the reCAPTCHA Enterprise enforcement state for the provider is set to ENFORCE or AUDIT.
|
|
66
|
+
*
|
|
67
|
+
* @param providerStr - The provider whose enablement state is to be returned.
|
|
68
|
+
* @returns Whether or not reCAPTCHA Enterprise protection is enabled for the given provider.
|
|
69
|
+
*/
|
|
70
|
+
isProviderEnabled(providerStr: string): boolean;
|
|
56
71
|
}
|
|
@@ -39,4 +39,7 @@ export declare class RecaptchaEnterpriseVerifier {
|
|
|
39
39
|
verify(action?: string, forceRefresh?: boolean): Promise<string>;
|
|
40
40
|
}
|
|
41
41
|
export declare function injectRecaptchaFields<T>(auth: AuthInternal, request: T, action: RecaptchaActionName, captchaResp?: boolean): Promise<T>;
|
|
42
|
+
declare type ActionMethod<TRequest, TResponse> = (auth: Auth, request: TRequest) => Promise<TResponse>;
|
|
43
|
+
export declare function handleRecaptchaFlow<TRequest, TResponse>(authInstance: AuthInternal, request: TRequest, actionName: RecaptchaActionName, actionMethod: ActionMethod<TRequest, TResponse>): Promise<TResponse>;
|
|
42
44
|
export declare function _initializeRecaptchaConfig(auth: Auth): Promise<void>;
|
|
45
|
+
export {};
|
|
@@ -103,53 +103,6 @@ var ActionCodeOperation = {
|
|
|
103
103
|
VERIFY_EMAIL: 'VERIFY_EMAIL'
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
/**
|
|
107
|
-
* @license
|
|
108
|
-
* Copyright 2020 Google LLC
|
|
109
|
-
*
|
|
110
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
111
|
-
* you may not use this file except in compliance with the License.
|
|
112
|
-
* You may obtain a copy of the License at
|
|
113
|
-
*
|
|
114
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
115
|
-
*
|
|
116
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
117
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
118
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
119
|
-
* See the License for the specific language governing permissions and
|
|
120
|
-
* limitations under the License.
|
|
121
|
-
*/
|
|
122
|
-
function isV2(grecaptcha) {
|
|
123
|
-
return (grecaptcha !== undefined &&
|
|
124
|
-
grecaptcha.getResponse !== undefined);
|
|
125
|
-
}
|
|
126
|
-
function isEnterprise(grecaptcha) {
|
|
127
|
-
return (grecaptcha !== undefined &&
|
|
128
|
-
grecaptcha.enterprise !== undefined);
|
|
129
|
-
}
|
|
130
|
-
var RecaptchaConfig = /** @class */ (function () {
|
|
131
|
-
function RecaptchaConfig(response) {
|
|
132
|
-
/**
|
|
133
|
-
* The reCAPTCHA site key.
|
|
134
|
-
*/
|
|
135
|
-
this.siteKey = '';
|
|
136
|
-
/**
|
|
137
|
-
* The reCAPTCHA enablement status of the {@link EmailAuthProvider} for the current tenant.
|
|
138
|
-
*/
|
|
139
|
-
this.emailPasswordEnabled = false;
|
|
140
|
-
if (response.recaptchaKey === undefined) {
|
|
141
|
-
throw new Error('recaptchaKey undefined');
|
|
142
|
-
}
|
|
143
|
-
// Example response.recaptchaKey: "projects/proj123/keys/sitekey123"
|
|
144
|
-
this.siteKey = response.recaptchaKey.split('/')[3];
|
|
145
|
-
this.emailPasswordEnabled = response.recaptchaEnforcementState.some(function (enforcementState) {
|
|
146
|
-
return enforcementState.provider === 'EMAIL_PASSWORD_PROVIDER' &&
|
|
147
|
-
enforcementState.enforcementState !== 'OFF';
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
return RecaptchaConfig;
|
|
151
|
-
}());
|
|
152
|
-
|
|
153
106
|
/**
|
|
154
107
|
* @license
|
|
155
108
|
* Copyright 2020 Google LLC
|
|
@@ -1060,6 +1013,18 @@ function _getFinalTarget(auth, host, path, query) {
|
|
|
1060
1013
|
}
|
|
1061
1014
|
return _emulatorUrl(auth.config, base);
|
|
1062
1015
|
}
|
|
1016
|
+
function _parseEnforcementState(enforcementStateStr) {
|
|
1017
|
+
switch (enforcementStateStr) {
|
|
1018
|
+
case 'ENFORCE':
|
|
1019
|
+
return "ENFORCE" /* EnforcementState.ENFORCE */;
|
|
1020
|
+
case 'AUDIT':
|
|
1021
|
+
return "AUDIT" /* EnforcementState.AUDIT */;
|
|
1022
|
+
case 'OFF':
|
|
1023
|
+
return "OFF" /* EnforcementState.OFF */;
|
|
1024
|
+
default:
|
|
1025
|
+
return "ENFORCEMENT_STATE_UNSPECIFIED" /* EnforcementState.ENFORCEMENT_STATE_UNSPECIFIED */;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1063
1028
|
var NetworkTimeout = /** @class */ (function () {
|
|
1064
1029
|
function NetworkTimeout(auth) {
|
|
1065
1030
|
var _this = this;
|
|
@@ -1095,6 +1060,81 @@ function _makeTaggedError(auth, code, response) {
|
|
|
1095
1060
|
return error;
|
|
1096
1061
|
}
|
|
1097
1062
|
|
|
1063
|
+
/**
|
|
1064
|
+
* @license
|
|
1065
|
+
* Copyright 2020 Google LLC
|
|
1066
|
+
*
|
|
1067
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1068
|
+
* you may not use this file except in compliance with the License.
|
|
1069
|
+
* You may obtain a copy of the License at
|
|
1070
|
+
*
|
|
1071
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1072
|
+
*
|
|
1073
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1074
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1075
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1076
|
+
* See the License for the specific language governing permissions and
|
|
1077
|
+
* limitations under the License.
|
|
1078
|
+
*/
|
|
1079
|
+
function isV2(grecaptcha) {
|
|
1080
|
+
return (grecaptcha !== undefined &&
|
|
1081
|
+
grecaptcha.getResponse !== undefined);
|
|
1082
|
+
}
|
|
1083
|
+
function isEnterprise(grecaptcha) {
|
|
1084
|
+
return (grecaptcha !== undefined &&
|
|
1085
|
+
grecaptcha.enterprise !== undefined);
|
|
1086
|
+
}
|
|
1087
|
+
var RecaptchaConfig = /** @class */ (function () {
|
|
1088
|
+
function RecaptchaConfig(response) {
|
|
1089
|
+
/**
|
|
1090
|
+
* The reCAPTCHA site key.
|
|
1091
|
+
*/
|
|
1092
|
+
this.siteKey = '';
|
|
1093
|
+
/**
|
|
1094
|
+
* The list of providers and their enablement status for reCAPTCHA Enterprise.
|
|
1095
|
+
*/
|
|
1096
|
+
this.recaptchaEnforcementState = [];
|
|
1097
|
+
if (response.recaptchaKey === undefined) {
|
|
1098
|
+
throw new Error('recaptchaKey undefined');
|
|
1099
|
+
}
|
|
1100
|
+
// Example response.recaptchaKey: "projects/proj123/keys/sitekey123"
|
|
1101
|
+
this.siteKey = response.recaptchaKey.split('/')[3];
|
|
1102
|
+
this.recaptchaEnforcementState = response.recaptchaEnforcementState;
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Returns the reCAPTCHA Enterprise enforcement state for the given provider.
|
|
1106
|
+
*
|
|
1107
|
+
* @param providerStr - The provider whose enforcement state is to be returned.
|
|
1108
|
+
* @returns The reCAPTCHA Enterprise enforcement state for the given provider.
|
|
1109
|
+
*/
|
|
1110
|
+
RecaptchaConfig.prototype.getProviderEnforcementState = function (providerStr) {
|
|
1111
|
+
if (!this.recaptchaEnforcementState ||
|
|
1112
|
+
this.recaptchaEnforcementState.length === 0) {
|
|
1113
|
+
return null;
|
|
1114
|
+
}
|
|
1115
|
+
for (var _i = 0, _a = this.recaptchaEnforcementState; _i < _a.length; _i++) {
|
|
1116
|
+
var recaptchaEnforcementState = _a[_i];
|
|
1117
|
+
if (recaptchaEnforcementState.provider &&
|
|
1118
|
+
recaptchaEnforcementState.provider === providerStr) {
|
|
1119
|
+
return _parseEnforcementState(recaptchaEnforcementState.enforcementState);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
return null;
|
|
1123
|
+
};
|
|
1124
|
+
/**
|
|
1125
|
+
* Returns true if the reCAPTCHA Enterprise enforcement state for the provider is set to ENFORCE or AUDIT.
|
|
1126
|
+
*
|
|
1127
|
+
* @param providerStr - The provider whose enablement state is to be returned.
|
|
1128
|
+
* @returns Whether or not reCAPTCHA Enterprise protection is enabled for the given provider.
|
|
1129
|
+
*/
|
|
1130
|
+
RecaptchaConfig.prototype.isProviderEnabled = function (providerStr) {
|
|
1131
|
+
return (this.getProviderEnforcementState(providerStr) ===
|
|
1132
|
+
"ENFORCE" /* EnforcementState.ENFORCE */ ||
|
|
1133
|
+
this.getProviderEnforcementState(providerStr) === "AUDIT" /* EnforcementState.AUDIT */);
|
|
1134
|
+
};
|
|
1135
|
+
return RecaptchaConfig;
|
|
1136
|
+
}());
|
|
1137
|
+
|
|
1098
1138
|
/**
|
|
1099
1139
|
* @license
|
|
1100
1140
|
* Copyright 2020 Google LLC
|
|
@@ -3777,6 +3817,39 @@ function injectRecaptchaFields(auth, request, action, captchaResp) {
|
|
|
3777
3817
|
});
|
|
3778
3818
|
});
|
|
3779
3819
|
}
|
|
3820
|
+
function handleRecaptchaFlow(authInstance, request, actionName, actionMethod) {
|
|
3821
|
+
var _a;
|
|
3822
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3823
|
+
var requestWithRecaptcha;
|
|
3824
|
+
var _this = this;
|
|
3825
|
+
return __generator(this, function (_b) {
|
|
3826
|
+
switch (_b.label) {
|
|
3827
|
+
case 0:
|
|
3828
|
+
if (!((_a = authInstance
|
|
3829
|
+
._getRecaptchaConfig()) === null || _a === void 0 ? void 0 : _a.isProviderEnabled("EMAIL_PASSWORD_PROVIDER" /* RecaptchaProvider.EMAIL_PASSWORD_PROVIDER */))) return [3 /*break*/, 2];
|
|
3830
|
+
return [4 /*yield*/, injectRecaptchaFields(authInstance, request, actionName, actionName === "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */)];
|
|
3831
|
+
case 1:
|
|
3832
|
+
requestWithRecaptcha = _b.sent();
|
|
3833
|
+
return [2 /*return*/, actionMethod(authInstance, requestWithRecaptcha)];
|
|
3834
|
+
case 2: return [2 /*return*/, actionMethod(authInstance, request).catch(function (error) { return __awaiter(_this, void 0, void 0, function () {
|
|
3835
|
+
var requestWithRecaptcha;
|
|
3836
|
+
return __generator(this, function (_a) {
|
|
3837
|
+
switch (_a.label) {
|
|
3838
|
+
case 0:
|
|
3839
|
+
if (!(error.code === "auth/".concat("missing-recaptcha-token" /* AuthErrorCode.MISSING_RECAPTCHA_TOKEN */))) return [3 /*break*/, 2];
|
|
3840
|
+
console.log("".concat(actionName, " is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow."));
|
|
3841
|
+
return [4 /*yield*/, injectRecaptchaFields(authInstance, request, actionName, actionName === "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */)];
|
|
3842
|
+
case 1:
|
|
3843
|
+
requestWithRecaptcha = _a.sent();
|
|
3844
|
+
return [2 /*return*/, actionMethod(authInstance, requestWithRecaptcha)];
|
|
3845
|
+
case 2: return [2 /*return*/, Promise.reject(error)];
|
|
3846
|
+
}
|
|
3847
|
+
});
|
|
3848
|
+
}); })];
|
|
3849
|
+
}
|
|
3850
|
+
});
|
|
3851
|
+
});
|
|
3852
|
+
}
|
|
3780
3853
|
function _initializeRecaptchaConfig(auth) {
|
|
3781
3854
|
return __awaiter(this, void 0, void 0, function () {
|
|
3782
3855
|
var authInternal, response, config, verifier;
|
|
@@ -3797,7 +3870,7 @@ function _initializeRecaptchaConfig(auth) {
|
|
|
3797
3870
|
else {
|
|
3798
3871
|
authInternal._tenantRecaptchaConfigs[authInternal.tenantId] = config;
|
|
3799
3872
|
}
|
|
3800
|
-
if (config.
|
|
3873
|
+
if (config.isProviderEnabled("EMAIL_PASSWORD_PROVIDER" /* RecaptchaProvider.EMAIL_PASSWORD_PROVIDER */)) {
|
|
3801
3874
|
verifier = new RecaptchaEnterpriseVerifier(authInternal);
|
|
3802
3875
|
void verifier.verify();
|
|
3803
3876
|
}
|
|
@@ -4263,55 +4336,27 @@ var EmailAuthCredential = /** @class */ (function (_super) {
|
|
|
4263
4336
|
};
|
|
4264
4337
|
/** @internal */
|
|
4265
4338
|
EmailAuthCredential.prototype._getIdTokenResponse = function (auth) {
|
|
4266
|
-
var _a;
|
|
4267
4339
|
return __awaiter(this, void 0, void 0, function () {
|
|
4268
|
-
var
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
_b = this.signInMethod;
|
|
4274
|
-
switch (_b) {
|
|
4275
|
-
case "password" /* SignInMethod.EMAIL_PASSWORD */: return [3 /*break*/, 1];
|
|
4276
|
-
case "emailLink" /* SignInMethod.EMAIL_LINK */: return [3 /*break*/, 4];
|
|
4277
|
-
}
|
|
4278
|
-
return [3 /*break*/, 5];
|
|
4279
|
-
case 1:
|
|
4280
|
-
request_1 = {
|
|
4340
|
+
var request;
|
|
4341
|
+
return __generator(this, function (_a) {
|
|
4342
|
+
switch (this.signInMethod) {
|
|
4343
|
+
case "password" /* SignInMethod.EMAIL_PASSWORD */:
|
|
4344
|
+
request = {
|
|
4281
4345
|
returnSecureToken: true,
|
|
4282
4346
|
email: this._email,
|
|
4283
4347
|
password: this._password,
|
|
4284
4348
|
clientType: "CLIENT_TYPE_WEB" /* RecaptchaClientType.WEB */
|
|
4285
4349
|
};
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
return __generator(this, function (_a) {
|
|
4294
|
-
switch (_a.label) {
|
|
4295
|
-
case 0:
|
|
4296
|
-
if (!(error.code === "auth/".concat("missing-recaptcha-token" /* AuthErrorCode.MISSING_RECAPTCHA_TOKEN */))) return [3 /*break*/, 2];
|
|
4297
|
-
console.log('Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.');
|
|
4298
|
-
return [4 /*yield*/, injectRecaptchaFields(auth, request_1, "signInWithPassword" /* RecaptchaActionName.SIGN_IN_WITH_PASSWORD */)];
|
|
4299
|
-
case 1:
|
|
4300
|
-
requestWithRecaptcha = _a.sent();
|
|
4301
|
-
return [2 /*return*/, signInWithPassword(auth, requestWithRecaptcha)];
|
|
4302
|
-
case 2: return [2 /*return*/, Promise.reject(error)];
|
|
4303
|
-
}
|
|
4304
|
-
});
|
|
4305
|
-
}); })];
|
|
4306
|
-
case 4: return [2 /*return*/, signInWithEmailLink$1(auth, {
|
|
4307
|
-
email: this._email,
|
|
4308
|
-
oobCode: this._password
|
|
4309
|
-
})];
|
|
4310
|
-
case 5:
|
|
4350
|
+
return [2 /*return*/, handleRecaptchaFlow(auth, request, "signInWithPassword" /* RecaptchaActionName.SIGN_IN_WITH_PASSWORD */, signInWithPassword)];
|
|
4351
|
+
case "emailLink" /* SignInMethod.EMAIL_LINK */:
|
|
4352
|
+
return [2 /*return*/, signInWithEmailLink$1(auth, {
|
|
4353
|
+
email: this._email,
|
|
4354
|
+
oobCode: this._password
|
|
4355
|
+
})];
|
|
4356
|
+
default:
|
|
4311
4357
|
_fail(auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
4312
|
-
_c.label = 6;
|
|
4313
|
-
case 6: return [2 /*return*/];
|
|
4314
4358
|
}
|
|
4359
|
+
return [2 /*return*/];
|
|
4315
4360
|
});
|
|
4316
4361
|
});
|
|
4317
4362
|
};
|
|
@@ -6528,12 +6573,10 @@ function recachePasswordPolicy(auth) {
|
|
|
6528
6573
|
* @public
|
|
6529
6574
|
*/
|
|
6530
6575
|
function sendPasswordResetEmail(auth, email, actionCodeSettings) {
|
|
6531
|
-
var _a;
|
|
6532
6576
|
return __awaiter(this, void 0, void 0, function () {
|
|
6533
|
-
var authInternal, request
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
switch (_b.label) {
|
|
6577
|
+
var authInternal, request;
|
|
6578
|
+
return __generator(this, function (_a) {
|
|
6579
|
+
switch (_a.label) {
|
|
6537
6580
|
case 0:
|
|
6538
6581
|
authInternal = _castAuth(auth);
|
|
6539
6582
|
request = {
|
|
@@ -6541,48 +6584,13 @@ function sendPasswordResetEmail(auth, email, actionCodeSettings) {
|
|
|
6541
6584
|
email: email,
|
|
6542
6585
|
clientType: "CLIENT_TYPE_WEB" /* RecaptchaClientType.WEB */
|
|
6543
6586
|
};
|
|
6544
|
-
if (!((_a = authInternal._getRecaptchaConfig()) === null || _a === void 0 ? void 0 : _a.emailPasswordEnabled)) return [3 /*break*/, 3];
|
|
6545
|
-
return [4 /*yield*/, injectRecaptchaFields(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, true)];
|
|
6546
|
-
case 1:
|
|
6547
|
-
requestWithRecaptcha = _b.sent();
|
|
6548
|
-
if (actionCodeSettings) {
|
|
6549
|
-
_setActionCodeSettingsOnRequest(authInternal, requestWithRecaptcha, actionCodeSettings);
|
|
6550
|
-
}
|
|
6551
|
-
return [4 /*yield*/, sendPasswordResetEmail$1(authInternal, requestWithRecaptcha)];
|
|
6552
|
-
case 2:
|
|
6553
|
-
_b.sent();
|
|
6554
|
-
return [3 /*break*/, 5];
|
|
6555
|
-
case 3:
|
|
6556
6587
|
if (actionCodeSettings) {
|
|
6557
6588
|
_setActionCodeSettingsOnRequest(authInternal, request, actionCodeSettings);
|
|
6558
6589
|
}
|
|
6559
|
-
return [4 /*yield*/,
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
switch (_a.label) {
|
|
6564
|
-
case 0:
|
|
6565
|
-
if (!(error.code === "auth/".concat("missing-recaptcha-token" /* AuthErrorCode.MISSING_RECAPTCHA_TOKEN */))) return [3 /*break*/, 3];
|
|
6566
|
-
console.log('Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.');
|
|
6567
|
-
return [4 /*yield*/, injectRecaptchaFields(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, true)];
|
|
6568
|
-
case 1:
|
|
6569
|
-
requestWithRecaptcha = _a.sent();
|
|
6570
|
-
if (actionCodeSettings) {
|
|
6571
|
-
_setActionCodeSettingsOnRequest(authInternal, requestWithRecaptcha, actionCodeSettings);
|
|
6572
|
-
}
|
|
6573
|
-
return [4 /*yield*/, sendPasswordResetEmail$1(authInternal, requestWithRecaptcha)];
|
|
6574
|
-
case 2:
|
|
6575
|
-
_a.sent();
|
|
6576
|
-
return [3 /*break*/, 4];
|
|
6577
|
-
case 3: return [2 /*return*/, Promise.reject(error)];
|
|
6578
|
-
case 4: return [2 /*return*/];
|
|
6579
|
-
}
|
|
6580
|
-
});
|
|
6581
|
-
}); })];
|
|
6582
|
-
case 4:
|
|
6583
|
-
_b.sent();
|
|
6584
|
-
_b.label = 5;
|
|
6585
|
-
case 5: return [2 /*return*/];
|
|
6590
|
+
return [4 /*yield*/, handleRecaptchaFlow(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, sendPasswordResetEmail$1)];
|
|
6591
|
+
case 1:
|
|
6592
|
+
_a.sent();
|
|
6593
|
+
return [2 /*return*/];
|
|
6586
6594
|
}
|
|
6587
6595
|
});
|
|
6588
6596
|
});
|
|
@@ -6737,12 +6745,10 @@ function verifyPasswordResetCode(auth, code) {
|
|
|
6737
6745
|
* @public
|
|
6738
6746
|
*/
|
|
6739
6747
|
function createUserWithEmailAndPassword(auth, email, password) {
|
|
6740
|
-
var _a;
|
|
6741
6748
|
return __awaiter(this, void 0, void 0, function () {
|
|
6742
|
-
var authInternal, request, signUpResponse,
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
switch (_b.label) {
|
|
6749
|
+
var authInternal, request, signUpResponse, response, userCredential;
|
|
6750
|
+
return __generator(this, function (_a) {
|
|
6751
|
+
switch (_a.label) {
|
|
6746
6752
|
case 0:
|
|
6747
6753
|
authInternal = _castAuth(auth);
|
|
6748
6754
|
request = {
|
|
@@ -6751,43 +6757,21 @@ function createUserWithEmailAndPassword(auth, email, password) {
|
|
|
6751
6757
|
password: password,
|
|
6752
6758
|
clientType: "CLIENT_TYPE_WEB" /* RecaptchaClientType.WEB */
|
|
6753
6759
|
};
|
|
6754
|
-
|
|
6755
|
-
return [4 /*yield*/,
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
signUpResponse = signUp(authInternal, requestWithRecaptcha);
|
|
6759
|
-
return [3 /*break*/, 3];
|
|
6760
|
-
case 2:
|
|
6761
|
-
signUpResponse = signUp(authInternal, request).catch(function (error) { return __awaiter(_this, void 0, void 0, function () {
|
|
6762
|
-
var requestWithRecaptcha;
|
|
6763
|
-
return __generator(this, function (_a) {
|
|
6764
|
-
switch (_a.label) {
|
|
6765
|
-
case 0:
|
|
6766
|
-
if (!(error.code === "auth/".concat("missing-recaptcha-token" /* AuthErrorCode.MISSING_RECAPTCHA_TOKEN */))) return [3 /*break*/, 2];
|
|
6767
|
-
console.log('Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow.');
|
|
6768
|
-
return [4 /*yield*/, injectRecaptchaFields(authInternal, request, "signUpPassword" /* RecaptchaActionName.SIGN_UP_PASSWORD */)];
|
|
6769
|
-
case 1:
|
|
6770
|
-
requestWithRecaptcha = _a.sent();
|
|
6771
|
-
return [2 /*return*/, signUp(authInternal, requestWithRecaptcha)];
|
|
6772
|
-
case 2: throw error;
|
|
6760
|
+
signUpResponse = handleRecaptchaFlow(authInternal, request, "signUpPassword" /* RecaptchaActionName.SIGN_UP_PASSWORD */, signUp);
|
|
6761
|
+
return [4 /*yield*/, signUpResponse.catch(function (error) {
|
|
6762
|
+
if (error.code === "auth/".concat("password-does-not-meet-requirements" /* AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS */)) {
|
|
6763
|
+
void recachePasswordPolicy(auth);
|
|
6773
6764
|
}
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
if (error.code === "auth/".concat("password-does-not-meet-requirements" /* AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS */)) {
|
|
6779
|
-
void recachePasswordPolicy(auth);
|
|
6780
|
-
}
|
|
6781
|
-
throw error;
|
|
6782
|
-
})];
|
|
6783
|
-
case 4:
|
|
6784
|
-
response = _b.sent();
|
|
6765
|
+
throw error;
|
|
6766
|
+
})];
|
|
6767
|
+
case 1:
|
|
6768
|
+
response = _a.sent();
|
|
6785
6769
|
return [4 /*yield*/, UserCredentialImpl._fromIdTokenResponse(authInternal, "signIn" /* OperationType.SIGN_IN */, response)];
|
|
6786
|
-
case
|
|
6787
|
-
userCredential =
|
|
6770
|
+
case 2:
|
|
6771
|
+
userCredential = _a.sent();
|
|
6788
6772
|
return [4 /*yield*/, authInternal._updateCurrentUser(userCredential.user)];
|
|
6789
|
-
case
|
|
6790
|
-
|
|
6773
|
+
case 3:
|
|
6774
|
+
_a.sent();
|
|
6791
6775
|
return [2 /*return*/, userCredential];
|
|
6792
6776
|
}
|
|
6793
6777
|
});
|
|
@@ -6876,7 +6860,6 @@ function signInWithEmailAndPassword(auth, email, password) {
|
|
|
6876
6860
|
* @public
|
|
6877
6861
|
*/
|
|
6878
6862
|
function sendSignInLinkToEmail(auth, email, actionCodeSettings) {
|
|
6879
|
-
var _a;
|
|
6880
6863
|
return __awaiter(this, void 0, void 0, function () {
|
|
6881
6864
|
function setActionCodeSettings(request, actionCodeSettings) {
|
|
6882
6865
|
_assert(actionCodeSettings.handleCodeInApp, authInternal, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
@@ -6884,10 +6867,9 @@ function sendSignInLinkToEmail(auth, email, actionCodeSettings) {
|
|
|
6884
6867
|
_setActionCodeSettingsOnRequest(authInternal, request, actionCodeSettings);
|
|
6885
6868
|
}
|
|
6886
6869
|
}
|
|
6887
|
-
var authInternal, request
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
switch (_b.label) {
|
|
6870
|
+
var authInternal, request;
|
|
6871
|
+
return __generator(this, function (_a) {
|
|
6872
|
+
switch (_a.label) {
|
|
6891
6873
|
case 0:
|
|
6892
6874
|
authInternal = _castAuth(auth);
|
|
6893
6875
|
request = {
|
|
@@ -6895,42 +6877,11 @@ function sendSignInLinkToEmail(auth, email, actionCodeSettings) {
|
|
|
6895
6877
|
email: email,
|
|
6896
6878
|
clientType: "CLIENT_TYPE_WEB" /* RecaptchaClientType.WEB */
|
|
6897
6879
|
};
|
|
6898
|
-
if (!((_a = authInternal._getRecaptchaConfig()) === null || _a === void 0 ? void 0 : _a.emailPasswordEnabled)) return [3 /*break*/, 3];
|
|
6899
|
-
return [4 /*yield*/, injectRecaptchaFields(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, true)];
|
|
6900
|
-
case 1:
|
|
6901
|
-
requestWithRecaptcha = _b.sent();
|
|
6902
|
-
setActionCodeSettings(requestWithRecaptcha, actionCodeSettings);
|
|
6903
|
-
return [4 /*yield*/, sendSignInLinkToEmail$1(authInternal, requestWithRecaptcha)];
|
|
6904
|
-
case 2:
|
|
6905
|
-
_b.sent();
|
|
6906
|
-
return [3 /*break*/, 5];
|
|
6907
|
-
case 3:
|
|
6908
6880
|
setActionCodeSettings(request, actionCodeSettings);
|
|
6909
|
-
return [4 /*yield*/,
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
switch (_a.label) {
|
|
6914
|
-
case 0:
|
|
6915
|
-
if (!(error.code === "auth/".concat("missing-recaptcha-token" /* AuthErrorCode.MISSING_RECAPTCHA_TOKEN */))) return [3 /*break*/, 3];
|
|
6916
|
-
console.log('Email link sign-in is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.');
|
|
6917
|
-
return [4 /*yield*/, injectRecaptchaFields(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, true)];
|
|
6918
|
-
case 1:
|
|
6919
|
-
requestWithRecaptcha = _a.sent();
|
|
6920
|
-
setActionCodeSettings(requestWithRecaptcha, actionCodeSettings);
|
|
6921
|
-
return [4 /*yield*/, sendSignInLinkToEmail$1(authInternal, requestWithRecaptcha)];
|
|
6922
|
-
case 2:
|
|
6923
|
-
_a.sent();
|
|
6924
|
-
return [3 /*break*/, 4];
|
|
6925
|
-
case 3: return [2 /*return*/, Promise.reject(error)];
|
|
6926
|
-
case 4: return [2 /*return*/];
|
|
6927
|
-
}
|
|
6928
|
-
});
|
|
6929
|
-
}); })];
|
|
6930
|
-
case 4:
|
|
6931
|
-
_b.sent();
|
|
6932
|
-
_b.label = 5;
|
|
6933
|
-
case 5: return [2 /*return*/];
|
|
6881
|
+
return [4 /*yield*/, handleRecaptchaFlow(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, sendSignInLinkToEmail$1)];
|
|
6882
|
+
case 1:
|
|
6883
|
+
_a.sent();
|
|
6884
|
+
return [2 /*return*/];
|
|
6934
6885
|
}
|
|
6935
6886
|
});
|
|
6936
6887
|
});
|
|
@@ -12214,7 +12165,7 @@ function _isEmptyString(input) {
|
|
|
12214
12165
|
}
|
|
12215
12166
|
|
|
12216
12167
|
var name = "@firebase/auth";
|
|
12217
|
-
var version = "1.3.0-canary.
|
|
12168
|
+
var version = "1.3.0-canary.68927ced1";
|
|
12218
12169
|
|
|
12219
12170
|
/**
|
|
12220
12171
|
* @license
|
|
@@ -12467,4 +12418,4 @@ function getAuth(app) {
|
|
|
12467
12418
|
registerAuth("Browser" /* ClientPlatform.BROWSER */);
|
|
12468
12419
|
|
|
12469
12420
|
export { signInAnonymously as $, ActionCodeOperation as A, updateCurrentUser as B, signOut as C, deleteUser as D, debugErrorMap as E, FactorId as F, prodErrorMap as G, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as H, initializeAuth as I, connectAuthEmulator as J, AuthCredential as K, EmailAuthCredential as L, OAuthCredential as M, PhoneAuthCredential as N, OperationType as O, PhoneAuthProvider as P, inMemoryPersistence as Q, RecaptchaVerifier as R, SignInMethod as S, TotpMultiFactorGenerator as T, EmailAuthProvider as U, FacebookAuthProvider as V, GoogleAuthProvider as W, GithubAuthProvider as X, OAuthProvider as Y, SAMLAuthProvider as Z, TwitterAuthProvider as _, browserSessionPersistence as a, signInWithCredential as a0, linkWithCredential as a1, reauthenticateWithCredential as a2, signInWithCustomToken as a3, sendPasswordResetEmail as a4, confirmPasswordReset as a5, applyActionCode as a6, checkActionCode as a7, verifyPasswordResetCode as a8, createUserWithEmailAndPassword as a9, _assert as aA, _createError as aB, AuthEventManager as aC, _getInstance as aD, _persistenceKeyName as aE, _clearRedirectOutcomes as aF, _getRedirectResult as aG, _overrideRedirectResult as aH, _castAuth as aI, UserImpl as aJ, AuthImpl as aK, _getClientVersion as aL, _generateEventId as aM, AuthPopup as aN, FetchProvider as aO, SAMLAuthCredential as aP, signInWithEmailAndPassword as aa, sendSignInLinkToEmail as ab, isSignInWithEmailLink as ac, signInWithEmailLink as ad, fetchSignInMethodsForEmail as ae, sendEmailVerification as af, verifyBeforeUpdateEmail as ag, ActionCodeURL as ah, parseActionCodeURL as ai, updateProfile as aj, updateEmail as ak, updatePassword as al, getIdToken as am, getIdTokenResult as an, unlink as ao, getAdditionalUserInfo as ap, reload as aq, getMultiFactorResolver as ar, multiFactor as as, _isIOS as at, _isAndroid as au, _fail as av, _getRedirectUrl as aw, debugAssert as ax, _getProjectConfig as ay, _isIOS7Or8 as az, browserLocalPersistence as b, signInWithPopup as c, linkWithPopup as d, reauthenticateWithPopup as e, signInWithRedirect as f, linkWithRedirect as g, reauthenticateWithRedirect as h, indexedDBLocalPersistence as i, getRedirectResult as j, browserPopupRedirectResolver as k, linkWithPhoneNumber as l, PhoneMultiFactorGenerator as m, TotpSecret as n, getAuth as o, ProviderId as p, setPersistence as q, reauthenticateWithPhoneNumber as r, signInWithPhoneNumber as s, initializeRecaptchaConfig as t, updatePhoneNumber as u, validatePassword as v, onIdTokenChanged as w, beforeAuthStateChanged as x, onAuthStateChanged as y, useDeviceLanguage as z };
|
|
12470
|
-
//# sourceMappingURL=index-
|
|
12421
|
+
//# sourceMappingURL=index-ebd5dc65.js.map
|