@firebase/auth 0.22.0 → 0.23.0-canary.0a27d2fbf
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-5df83e84.js} +590 -207
- package/dist/browser-cjs/index-5df83e84.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-b3f8e40c.js} +778 -214
- package/dist/cordova/popup_redirect-b3f8e40c.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-6cb4f120.js} +591 -209
- package/dist/esm2017/index-6cb4f120.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-4dc6213a.js} +797 -289
- package/dist/esm5/index-4dc6213a.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-c1b55906.js} +700 -171
- package/dist/node/totp-c1b55906.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-5cad7b9f.js} +557 -140
- package/dist/node-esm/totp-5cad7b9f.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-5059d9ba.js} +738 -259
- package/dist/rn/phone-5059d9ba.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
|
@@ -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>;
|
package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.test.d.ts
ADDED
|
@@ -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>;
|
package/dist/cordova/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getApp, _getProvider } from '@firebase/app';
|
|
2
|
-
import { _ as _signInWithRedirect, a as _reauthenticateWithRedirect, b as _linkWithRedirect, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, d as cordovaPopupRedirectResolver } from './popup_redirect-
|
|
3
|
-
export { A as ActionCodeOperation,
|
|
2
|
+
import { _ as _signInWithRedirect, a as _reauthenticateWithRedirect, b as _linkWithRedirect, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, d as cordovaPopupRedirectResolver } from './popup_redirect-b3f8e40c.js';
|
|
3
|
+
export { A as ActionCodeOperation, a4 as ActionCodeURL, w as AuthCredential, t as AuthErrorCodes, E as EmailAuthCredential, B as EmailAuthProvider, C as FacebookAuthProvider, F as FactorId, D as GithubAuthProvider, G as GoogleAuthProvider, x as OAuthCredential, H as OAuthProvider, O as OperationType, y as PhoneAuthCredential, P as ProviderId, I as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, U as applyActionCode, j as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, V as checkActionCode, R as confirmPasswordReset, v as connectAuthEmulator, d as cordovaPopupRedirectResolver, X as createUserWithEmailAndPassword, p as debugErrorMap, n as deleteUser, a1 as fetchSignInMethodsForEmail, ac as getAdditionalUserInfo, a9 as getIdToken, aa as getIdTokenResult, ae as getMultiFactorResolver, g as getRedirectResult, z as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, h as initializeRecaptchaConfig, $ as isSignInWithEmailLink, L as linkWithCredential, af as multiFactor, k as onAuthStateChanged, o as onIdTokenChanged, a5 as parseActionCodeURL, q as prodErrorMap, M as reauthenticateWithCredential, ad as reload, a2 as sendEmailVerification, Q as sendPasswordResetEmail, Z as sendSignInLinkToEmail, s as setPersistence, J as signInAnonymously, K as signInWithCredential, N as signInWithCustomToken, Y as signInWithEmailAndPassword, a0 as signInWithEmailLink, m as signOut, ab as unlink, l as updateCurrentUser, a7 as updateEmail, a8 as updatePassword, a6 as updateProfile, u as useDeviceLanguage, a3 as verifyBeforeUpdateEmail, W as verifyPasswordResetCode } from './popup_redirect-b3f8e40c.js';
|
|
4
4
|
import 'tslib';
|
|
5
5
|
import '@firebase/util';
|
|
6
6
|
import '@firebase/component';
|
package/dist/cordova/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActionCodeOperation,
|
|
1
|
+
import { ag as _performApiRequest, ah as _addTidIfNecessary, ai as _assert, aj as Delay, ak as _window, al as isV2, am as _createError, an as _loadJS, ao as _generateCallbackName, ap as getRecaptchaParams, aq as _isHttpOrHttps, ar as _isWorker, as as _castAuth, K as signInWithCredential, L as linkWithCredential, at as _assertLinkedStatus, M as reauthenticateWithCredential, au as sendPhoneVerificationCode, av as startEnrollPhoneMfa, aw as _link, y as PhoneAuthCredential, ax as debugAssert, ay as _generateEventId, az as AbstractPopupRedirectOperation, aA as _assertInstanceOf, aB as _withDefaultResolver, aC as FederatedAuthProvider, aD as _fail, aE as _getProjectConfig, aF as _getCurrentUrl, aG as _emulatorUrl, aH as _isChromeIOS, aI as _isFirefox, aJ as _isIOSStandalone, aK as _getRedirectUrl, aL as _setWindowLocation, aM as _isMobileBrowser, aN as _isSafari, aO as _isIOS, f as browserSessionPersistence, aP as _getRedirectResult, aQ as _overrideRedirectResult, aR as AuthEventManager, aS as debugFail, aT as finalizeEnrollPhoneMfa, aU as finalizeEnrollTotpMfa, aV as startEnrollTotpMfa, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, e as browserLocalPersistence, j as beforeAuthStateChanged, o as onIdTokenChanged, v as connectAuthEmulator } from './popup_redirect-b3f8e40c.js';
|
|
2
|
+
export { A as ActionCodeOperation, a4 as ActionCodeURL, w as AuthCredential, t as AuthErrorCodes, aZ as AuthImpl, E as EmailAuthCredential, B as EmailAuthProvider, C as FacebookAuthProvider, F as FactorId, a$ as FetchProvider, D as GithubAuthProvider, G as GoogleAuthProvider, x as OAuthCredential, H as OAuthProvider, O as OperationType, y as PhoneAuthCredential, P as ProviderId, b0 as SAMLAuthCredential, I as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, aX as UserImpl, ai as _assert, as as _castAuth, aD as _fail, ay as _generateEventId, a_ as _getClientVersion, aY as _getInstance, aP as _getRedirectResult, aQ as _overrideRedirectResult, aW as _persistenceKeyName, U as applyActionCode, j as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, V as checkActionCode, R as confirmPasswordReset, v as connectAuthEmulator, d as cordovaPopupRedirectResolver, X as createUserWithEmailAndPassword, p as debugErrorMap, n as deleteUser, a1 as fetchSignInMethodsForEmail, ac as getAdditionalUserInfo, a9 as getIdToken, aa as getIdTokenResult, ae as getMultiFactorResolver, g as getRedirectResult, z as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, h as initializeRecaptchaConfig, $ as isSignInWithEmailLink, L as linkWithCredential, b2 as linkWithRedirect, af as multiFactor, k as onAuthStateChanged, o as onIdTokenChanged, a5 as parseActionCodeURL, q as prodErrorMap, M as reauthenticateWithCredential, b3 as reauthenticateWithRedirect, ad as reload, a2 as sendEmailVerification, Q as sendPasswordResetEmail, Z as sendSignInLinkToEmail, s as setPersistence, J as signInAnonymously, K as signInWithCredential, N as signInWithCustomToken, Y as signInWithEmailAndPassword, a0 as signInWithEmailLink, b1 as signInWithRedirect, m as signOut, ab as unlink, l as updateCurrentUser, a7 as updateEmail, a8 as updatePassword, a6 as updateProfile, u as useDeviceLanguage, a3 as verifyBeforeUpdateEmail, W as verifyPasswordResetCode } from './popup_redirect-b3f8e40c.js';
|
|
3
3
|
import { __awaiter, __generator, __assign, __extends, __spreadArray } from 'tslib';
|
|
4
4
|
import { querystring, getModularInstance, getUA, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
|
|
5
5
|
import { SDK_VERSION, getApp, _getProvider } from '@firebase/app';
|
|
@@ -32,73 +32,6 @@ function finalizeSignInTotpMfa(auth, request) {
|
|
|
32
32
|
return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts/mfaSignIn:finalize" /* Endpoint.FINALIZE_MFA_SIGN_IN */, _addTidIfNecessary(auth, request));
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* @license
|
|
37
|
-
* Copyright 2020 Google LLC
|
|
38
|
-
*
|
|
39
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
40
|
-
* you may not use this file except in compliance with the License.
|
|
41
|
-
* You may obtain a copy of the License at
|
|
42
|
-
*
|
|
43
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
44
|
-
*
|
|
45
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
46
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
47
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
48
|
-
* See the License for the specific language governing permissions and
|
|
49
|
-
* limitations under the License.
|
|
50
|
-
*/
|
|
51
|
-
function getRecaptchaParams(auth) {
|
|
52
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
-
return __generator(this, function (_a) {
|
|
54
|
-
switch (_a.label) {
|
|
55
|
-
case 0: return [4 /*yield*/, _performApiRequest(auth, "GET" /* HttpMethod.GET */, "/v1/recaptchaParams" /* Endpoint.GET_RECAPTCHA_PARAM */)];
|
|
56
|
-
case 1: return [2 /*return*/, ((_a.sent()).recaptchaSiteKey || '')];
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @license
|
|
64
|
-
* Copyright 2020 Google LLC
|
|
65
|
-
*
|
|
66
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
67
|
-
* you may not use this file except in compliance with the License.
|
|
68
|
-
* You may obtain a copy of the License at
|
|
69
|
-
*
|
|
70
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
71
|
-
*
|
|
72
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
73
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
74
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
75
|
-
* See the License for the specific language governing permissions and
|
|
76
|
-
* limitations under the License.
|
|
77
|
-
*/
|
|
78
|
-
function getScriptParentElement() {
|
|
79
|
-
var _a, _b;
|
|
80
|
-
return (_b = (_a = document.getElementsByTagName('head')) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : document;
|
|
81
|
-
}
|
|
82
|
-
function _loadJS(url) {
|
|
83
|
-
// TODO: consider adding timeout support & cancellation
|
|
84
|
-
return new Promise(function (resolve, reject) {
|
|
85
|
-
var el = document.createElement('script');
|
|
86
|
-
el.setAttribute('src', url);
|
|
87
|
-
el.onload = resolve;
|
|
88
|
-
el.onerror = function (e) {
|
|
89
|
-
var error = _createError("internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
90
|
-
error.customData = e;
|
|
91
|
-
reject(error);
|
|
92
|
-
};
|
|
93
|
-
el.type = 'text/javascript';
|
|
94
|
-
el.charset = 'UTF-8';
|
|
95
|
-
getScriptParentElement().appendChild(el);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
function _generateCallbackName(prefix) {
|
|
99
|
-
return "__".concat(prefix).concat(Math.floor(Math.random() * 1000000));
|
|
100
|
-
}
|
|
101
|
-
|
|
102
35
|
/**
|
|
103
36
|
* @license
|
|
104
37
|
* Copyright 2020 Google LLC
|
|
@@ -276,7 +209,7 @@ var ReCaptchaLoaderImpl = /** @class */ (function () {
|
|
|
276
209
|
var _this = this;
|
|
277
210
|
if (hl === void 0) { hl = ''; }
|
|
278
211
|
_assert(isHostLanguageValid(hl), auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
|
|
279
|
-
if (this.shouldResolveImmediately(hl)) {
|
|
212
|
+
if (this.shouldResolveImmediately(hl) && isV2(_window().grecaptcha)) {
|
|
280
213
|
return Promise.resolve(_window().grecaptcha);
|
|
281
214
|
}
|
|
282
215
|
return new Promise(function (resolve, reject) {
|
|
@@ -287,7 +220,7 @@ var ReCaptchaLoaderImpl = /** @class */ (function () {
|
|
|
287
220
|
_window().clearTimeout(networkTimeout);
|
|
288
221
|
delete _window()[_JSLOAD_CALLBACK];
|
|
289
222
|
var recaptcha = _window().grecaptcha;
|
|
290
|
-
if (!recaptcha) {
|
|
223
|
+
if (!recaptcha || !isV2(recaptcha)) {
|
|
291
224
|
reject(_createError(auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */));
|
|
292
225
|
return;
|
|
293
226
|
}
|
|
@@ -1237,11 +1170,13 @@ var PopupOperation = /** @class */ (function (_super) {
|
|
|
1237
1170
|
if ((_b = (_a = _this.authWindow) === null || _a === void 0 ? void 0 : _a.window) === null || _b === void 0 ? void 0 : _b.closed) {
|
|
1238
1171
|
// Make sure that there is sufficient time for whatever action to
|
|
1239
1172
|
// complete. The window could have closed but the sign in network
|
|
1240
|
-
// call could still be in flight.
|
|
1173
|
+
// call could still be in flight. This is specifically true for
|
|
1174
|
+
// Firefox or if the opener is in an iframe, in which case the oauth
|
|
1175
|
+
// helper closes the popup.
|
|
1241
1176
|
_this.pollId = window.setTimeout(function () {
|
|
1242
1177
|
_this.pollId = null;
|
|
1243
1178
|
_this.reject(_createError(_this.auth, "popup-closed-by-user" /* AuthErrorCode.POPUP_CLOSED_BY_USER */));
|
|
1244
|
-
},
|
|
1179
|
+
}, 8000 /* _Timeout.AUTH_EVENT */);
|
|
1245
1180
|
return;
|
|
1246
1181
|
}
|
|
1247
1182
|
_this.pollId = window.setTimeout(poll, _POLL_WINDOW_CLOSE_TIMEOUT.get());
|
|
@@ -1681,20 +1616,29 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
1681
1616
|
return __awaiter(this, void 0, void 0, function () {
|
|
1682
1617
|
var url;
|
|
1683
1618
|
return __generator(this, function (_b) {
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1619
|
+
switch (_b.label) {
|
|
1620
|
+
case 0:
|
|
1621
|
+
debugAssert((_a = this.eventManagers[auth._key()]) === null || _a === void 0 ? void 0 : _a.manager, '_initialize() not called before _openPopup()');
|
|
1622
|
+
return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, _getCurrentUrl(), eventId)];
|
|
1623
|
+
case 1:
|
|
1624
|
+
url = _b.sent();
|
|
1625
|
+
return [2 /*return*/, _open(auth, url, _generateEventId())];
|
|
1626
|
+
}
|
|
1687
1627
|
});
|
|
1688
1628
|
});
|
|
1689
1629
|
};
|
|
1690
1630
|
BrowserPopupRedirectResolver.prototype._openRedirect = function (auth, provider, authType, eventId) {
|
|
1691
1631
|
return __awaiter(this, void 0, void 0, function () {
|
|
1632
|
+
var url;
|
|
1692
1633
|
return __generator(this, function (_a) {
|
|
1693
1634
|
switch (_a.label) {
|
|
1694
1635
|
case 0: return [4 /*yield*/, this._originValidation(auth)];
|
|
1695
1636
|
case 1:
|
|
1696
1637
|
_a.sent();
|
|
1697
|
-
|
|
1638
|
+
return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, _getCurrentUrl(), eventId)];
|
|
1639
|
+
case 2:
|
|
1640
|
+
url = _a.sent();
|
|
1641
|
+
_setWindowLocation(url);
|
|
1698
1642
|
return [2 /*return*/, new Promise(function () { })];
|
|
1699
1643
|
}
|
|
1700
1644
|
});
|