@firebase/auth 1.13.1 → 1.13.2-eap-crashlytics.558ee841d
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/browser-cjs/{index-58b444b9.js → index-223cb6d8.js} +55 -15
- package/dist/browser-cjs/index-223cb6d8.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/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/browser-cjs/test/helpers/mock_loadjs.d.ts +17 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +2 -2
- package/dist/cordova/{popup_redirect-e90e6597.js → popup_redirect-8f954bab.js} +56 -16
- package/dist/cordova/popup_redirect-8f954bab.js.map +1 -0
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/cordova/test/helpers/mock_loadjs.d.ts +17 -0
- package/dist/esm/{index-907e9a1a.js → index-42b2f63a.js} +56 -16
- package/dist/esm/index-42b2f63a.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal.js +2 -2
- package/dist/esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/esm/test/helpers/mock_loadjs.d.ts +17 -0
- package/dist/index.webworker.js +55 -15
- package/dist/index.webworker.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +1 -1
- package/dist/node/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/node/test/helpers/mock_loadjs.d.ts +17 -0
- package/dist/node/{totp-ec1dc837.js → totp-1de3d98e.js} +39 -5
- package/dist/node/totp-1de3d98e.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/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/node-esm/test/helpers/mock_loadjs.d.ts +17 -0
- package/dist/node-esm/{totp-97daafa8.js → totp-16b08ec9.js} +40 -6
- package/dist/node-esm/totp-16b08ec9.js.map +1 -0
- package/dist/rn/{index-ec5272bc.js → index-3c01bc90.js} +39 -5
- package/dist/rn/index-3c01bc90.js.map +1 -0
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +18 -12
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/rn/test/helpers/mock_loadjs.d.ts +17 -0
- package/dist/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/test/helpers/mock_loadjs.d.ts +17 -0
- package/dist/web-extension-cjs/index.js +1 -1
- package/dist/web-extension-cjs/internal.js +1 -1
- package/dist/web-extension-cjs/{register-410eef86.js → register-6a93d6fa.js} +55 -15
- package/dist/web-extension-cjs/register-6a93d6fa.js.map +1 -0
- package/dist/web-extension-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/web-extension-cjs/test/helpers/mock_loadjs.d.ts +17 -0
- package/dist/web-extension-esm/index.js +2 -2
- package/dist/web-extension-esm/internal.js +2 -2
- package/dist/web-extension-esm/{register-4207f7c7.js → register-6e13f5d2.js} +56 -16
- package/dist/web-extension-esm/register-6e13f5d2.js.map +1 -0
- package/dist/web-extension-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +18 -0
- package/dist/web-extension-esm/test/helpers/mock_loadjs.d.ts +17 -0
- package/package.json +6 -6
- package/dist/browser-cjs/index-58b444b9.js.map +0 -1
- package/dist/cordova/popup_redirect-e90e6597.js.map +0 -1
- package/dist/esm/index-907e9a1a.js.map +0 -1
- package/dist/node/totp-ec1dc837.js.map +0 -1
- package/dist/node-esm/totp-97daafa8.js.map +0 -1
- package/dist/rn/index-ec5272bc.js.map +0 -1
- package/dist/web-extension-cjs/register-410eef86.js.map +0 -1
- package/dist/web-extension-esm/register-4207f7c7.js.map +0 -1
|
@@ -19,12 +19,30 @@ import { Auth } from '../../model/public_types';
|
|
|
19
19
|
import { AuthInternal } from '../../model/auth';
|
|
20
20
|
export declare const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = "recaptcha-enterprise";
|
|
21
21
|
export declare const FAKE_TOKEN = "NO_RECAPTCHA";
|
|
22
|
+
export declare const RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME = "onFirebaseAuthREInstanceReady";
|
|
23
|
+
declare global {
|
|
24
|
+
interface Window {
|
|
25
|
+
[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]: () => void;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
22
28
|
export declare class RecaptchaEnterpriseVerifier {
|
|
23
29
|
/**
|
|
24
30
|
* Identifies the type of application verifier (e.g. "recaptcha-enterprise").
|
|
25
31
|
*/
|
|
26
32
|
readonly type = "recaptcha-enterprise";
|
|
27
33
|
private readonly auth;
|
|
34
|
+
/**
|
|
35
|
+
* Deferred that resolves when script tag has been injected onto the page
|
|
36
|
+
* and the script is ready (grecaptcha.ready() and script.onload are not
|
|
37
|
+
* reliable indicators, so this resolves when the global
|
|
38
|
+
* `window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]()` callback provided to the recaptcha url param "onload"
|
|
39
|
+
* is triggered).
|
|
40
|
+
* As a static variable this is applied to all instances of the class.
|
|
41
|
+
* This will cause an error if users try to create multiple RecaptchaVerifiers
|
|
42
|
+
* with different Recaptcha Enterprise sitekeys, which should be an
|
|
43
|
+
* unuspported use case.
|
|
44
|
+
*/
|
|
45
|
+
private static scriptInjectionDeferred;
|
|
28
46
|
/**
|
|
29
47
|
*
|
|
30
48
|
* @param authExtern - The corresponding Firebase {@link Auth} instance.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 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 declare const mockLoadJS: () => Promise<Event>;
|
|
@@ -19,12 +19,30 @@ import { Auth } from '../../model/public_types';
|
|
|
19
19
|
import { AuthInternal } from '../../model/auth';
|
|
20
20
|
export declare const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = "recaptcha-enterprise";
|
|
21
21
|
export declare const FAKE_TOKEN = "NO_RECAPTCHA";
|
|
22
|
+
export declare const RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME = "onFirebaseAuthREInstanceReady";
|
|
23
|
+
declare global {
|
|
24
|
+
interface Window {
|
|
25
|
+
[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]: () => void;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
22
28
|
export declare class RecaptchaEnterpriseVerifier {
|
|
23
29
|
/**
|
|
24
30
|
* Identifies the type of application verifier (e.g. "recaptcha-enterprise").
|
|
25
31
|
*/
|
|
26
32
|
readonly type = "recaptcha-enterprise";
|
|
27
33
|
private readonly auth;
|
|
34
|
+
/**
|
|
35
|
+
* Deferred that resolves when script tag has been injected onto the page
|
|
36
|
+
* and the script is ready (grecaptcha.ready() and script.onload are not
|
|
37
|
+
* reliable indicators, so this resolves when the global
|
|
38
|
+
* `window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]()` callback provided to the recaptcha url param "onload"
|
|
39
|
+
* is triggered).
|
|
40
|
+
* As a static variable this is applied to all instances of the class.
|
|
41
|
+
* This will cause an error if users try to create multiple RecaptchaVerifiers
|
|
42
|
+
* with different Recaptcha Enterprise sitekeys, which should be an
|
|
43
|
+
* unuspported use case.
|
|
44
|
+
*/
|
|
45
|
+
private static scriptInjectionDeferred;
|
|
28
46
|
/**
|
|
29
47
|
*
|
|
30
48
|
* @param authExtern - The corresponding Firebase {@link Auth} instance.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 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 declare const mockLoadJS: () => Promise<Event>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var register = require('./register-
|
|
5
|
+
var register = require('./register-6a93d6fa.js');
|
|
6
6
|
var app = require('@firebase/app');
|
|
7
7
|
var util = require('@firebase/util');
|
|
8
8
|
require('@firebase/component');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var register = require('./register-
|
|
5
|
+
var register = require('./register-6a93d6fa.js');
|
|
6
6
|
var util = require('@firebase/util');
|
|
7
7
|
var app = require('@firebase/app');
|
|
8
8
|
require('@firebase/component');
|
|
@@ -3332,6 +3332,7 @@ function generateRandomAlphaNumericString(len) {
|
|
|
3332
3332
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
3333
3333
|
const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = 'recaptcha-enterprise';
|
|
3334
3334
|
const FAKE_TOKEN = 'NO_RECAPTCHA';
|
|
3335
|
+
const RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME = 'onFirebaseAuthREInstanceReady';
|
|
3335
3336
|
class RecaptchaEnterpriseVerifier {
|
|
3336
3337
|
/**
|
|
3337
3338
|
*
|
|
@@ -3411,8 +3412,13 @@ class RecaptchaEnterpriseVerifier {
|
|
|
3411
3412
|
}
|
|
3412
3413
|
return new Promise((resolve, reject) => {
|
|
3413
3414
|
retrieveSiteKey(this.auth)
|
|
3414
|
-
.then(siteKey => {
|
|
3415
|
-
if (!forceRefresh &&
|
|
3415
|
+
.then(async (siteKey) => {
|
|
3416
|
+
if (!forceRefresh &&
|
|
3417
|
+
isEnterprise(window.grecaptcha) &&
|
|
3418
|
+
// If download has already been initiated, do not trigger another
|
|
3419
|
+
// download, await the promise here.
|
|
3420
|
+
RecaptchaEnterpriseVerifier.scriptInjectionDeferred) {
|
|
3421
|
+
await RecaptchaEnterpriseVerifier.scriptInjectionDeferred.promise;
|
|
3416
3422
|
retrieveRecaptchaToken(siteKey, resolve, reject);
|
|
3417
3423
|
}
|
|
3418
3424
|
else {
|
|
@@ -3422,9 +3428,25 @@ class RecaptchaEnterpriseVerifier {
|
|
|
3422
3428
|
}
|
|
3423
3429
|
let url = _recaptchaEnterpriseScriptUrl();
|
|
3424
3430
|
if (url.length !== 0) {
|
|
3425
|
-
url +=
|
|
3431
|
+
url +=
|
|
3432
|
+
siteKey +
|
|
3433
|
+
`&onload=${RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME}`;
|
|
3426
3434
|
}
|
|
3435
|
+
// Existence of deferred indicates download has been initiated.
|
|
3436
|
+
RecaptchaEnterpriseVerifier.scriptInjectionDeferred =
|
|
3437
|
+
new util.Deferred();
|
|
3438
|
+
/**
|
|
3439
|
+
* Script attached to global window object that will be called
|
|
3440
|
+
* when the ReCAPTCHA Enterprise instance is ready.
|
|
3441
|
+
* grecaptcha.ready() is not reliable when there are multiple
|
|
3442
|
+
* scripts on the page, and script.onload only indicates the
|
|
3443
|
+
* script has downloaded, not that it has initialized.
|
|
3444
|
+
*/
|
|
3445
|
+
window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME] = () => {
|
|
3446
|
+
RecaptchaEnterpriseVerifier.scriptInjectionDeferred?.resolve();
|
|
3447
|
+
};
|
|
3427
3448
|
_loadJS(url)
|
|
3449
|
+
.then(() => RecaptchaEnterpriseVerifier.scriptInjectionDeferred?.promise)
|
|
3428
3450
|
.then(() => {
|
|
3429
3451
|
retrieveRecaptchaToken(siteKey, resolve, reject);
|
|
3430
3452
|
})
|
|
@@ -3439,6 +3461,18 @@ class RecaptchaEnterpriseVerifier {
|
|
|
3439
3461
|
});
|
|
3440
3462
|
}
|
|
3441
3463
|
}
|
|
3464
|
+
/**
|
|
3465
|
+
* Deferred that resolves when script tag has been injected onto the page
|
|
3466
|
+
* and the script is ready (grecaptcha.ready() and script.onload are not
|
|
3467
|
+
* reliable indicators, so this resolves when the global
|
|
3468
|
+
* `window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]()` callback provided to the recaptcha url param "onload"
|
|
3469
|
+
* is triggered).
|
|
3470
|
+
* As a static variable this is applied to all instances of the class.
|
|
3471
|
+
* This will cause an error if users try to create multiple RecaptchaVerifiers
|
|
3472
|
+
* with different Recaptcha Enterprise sitekeys, which should be an
|
|
3473
|
+
* unuspported use case.
|
|
3474
|
+
*/
|
|
3475
|
+
RecaptchaEnterpriseVerifier.scriptInjectionDeferred = null;
|
|
3442
3476
|
async function injectRecaptchaFields(auth, request, action, isCaptchaResp = false, isFakeToken = false) {
|
|
3443
3477
|
const verifier = new RecaptchaEnterpriseVerifier(auth);
|
|
3444
3478
|
let captchaResponse;
|
|
@@ -7678,6 +7712,7 @@ const _TRANSACTION_RETRY_COUNT = 3;
|
|
|
7678
7712
|
class IndexedDBLocalPersistence {
|
|
7679
7713
|
constructor() {
|
|
7680
7714
|
this.type = "LOCAL" /* PersistenceType.LOCAL */;
|
|
7715
|
+
this.dbPromise = null;
|
|
7681
7716
|
this._shouldAllowMigration = true;
|
|
7682
7717
|
this.listeners = {};
|
|
7683
7718
|
this.localCache = {};
|
|
@@ -7694,11 +7729,14 @@ class IndexedDBLocalPersistence {
|
|
|
7694
7729
|
this.initializeServiceWorkerMessaging().then(() => { }, () => { });
|
|
7695
7730
|
}
|
|
7696
7731
|
async _openDb() {
|
|
7697
|
-
if (this.
|
|
7698
|
-
return this.
|
|
7732
|
+
if (this.dbPromise) {
|
|
7733
|
+
return this.dbPromise;
|
|
7699
7734
|
}
|
|
7700
|
-
this.
|
|
7701
|
-
|
|
7735
|
+
this.dbPromise = _openDatabase();
|
|
7736
|
+
this.dbPromise.catch(() => {
|
|
7737
|
+
this.dbPromise = null;
|
|
7738
|
+
});
|
|
7739
|
+
return this.dbPromise;
|
|
7702
7740
|
}
|
|
7703
7741
|
async _withRetries(op) {
|
|
7704
7742
|
let numAttempts = 0;
|
|
@@ -7711,9 +7749,10 @@ class IndexedDBLocalPersistence {
|
|
|
7711
7749
|
if (numAttempts++ > _TRANSACTION_RETRY_COUNT) {
|
|
7712
7750
|
throw e;
|
|
7713
7751
|
}
|
|
7714
|
-
if (this.
|
|
7715
|
-
this.
|
|
7716
|
-
|
|
7752
|
+
if (this.dbPromise) {
|
|
7753
|
+
const db = await this.dbPromise;
|
|
7754
|
+
db.close();
|
|
7755
|
+
this.dbPromise = null;
|
|
7717
7756
|
}
|
|
7718
7757
|
// TODO: consider adding exponential backoff
|
|
7719
7758
|
}
|
|
@@ -7798,9 +7837,10 @@ class IndexedDBLocalPersistence {
|
|
|
7798
7837
|
if (!indexedDB) {
|
|
7799
7838
|
return false;
|
|
7800
7839
|
}
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7840
|
+
await this._withRetries(async (db) => {
|
|
7841
|
+
await _putObject(db, STORAGE_AVAILABLE_KEY, '1');
|
|
7842
|
+
await _deleteObject(db, STORAGE_AVAILABLE_KEY);
|
|
7843
|
+
});
|
|
7804
7844
|
return true;
|
|
7805
7845
|
}
|
|
7806
7846
|
catch { }
|
|
@@ -8107,7 +8147,7 @@ function _isEmptyString(input) {
|
|
|
8107
8147
|
}
|
|
8108
8148
|
|
|
8109
8149
|
var name = "@firebase/auth";
|
|
8110
|
-
var version = "1.13.
|
|
8150
|
+
var version = "1.13.2-eap-crashlytics.558ee841d";
|
|
8111
8151
|
|
|
8112
8152
|
/**
|
|
8113
8153
|
* @license
|
|
@@ -8371,4 +8411,4 @@ exports.useDeviceLanguage = useDeviceLanguage;
|
|
|
8371
8411
|
exports.validatePassword = validatePassword;
|
|
8372
8412
|
exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
|
|
8373
8413
|
exports.verifyPasswordResetCode = verifyPasswordResetCode;
|
|
8374
|
-
//# sourceMappingURL=register-
|
|
8414
|
+
//# sourceMappingURL=register-6a93d6fa.js.map
|