@firebase/auth 1.13.2 → 1.13.3-20260616165109
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-cb4d4017.js → index-4f266ff1.js} +42 -8
- package/dist/browser-cjs/index-4f266ff1.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-66dd494e.js → popup_redirect-517c6588.js} +43 -9
- package/dist/cordova/popup_redirect-517c6588.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-9d184c40.js → index-627e45d8.js} +43 -9
- package/dist/esm/index-627e45d8.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 +42 -8
- 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-90def736.js → totp-65d9d0d1.js} +42 -8
- package/dist/node/totp-65d9d0d1.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-5d40279f.js → totp-5eeabfcc.js} +43 -9
- package/dist/node-esm/totp-5eeabfcc.js.map +1 -0
- package/dist/rn/{index-d963ed8d.js → index-a0c71409.js} +42 -8
- package/dist/rn/index-a0c71409.js.map +1 -0
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +2 -2
- 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-5aa6f443.js → register-6e59a8d4.js} +42 -8
- package/dist/web-extension-cjs/register-6e59a8d4.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-01796967.js → register-65800ac3.js} +43 -9
- package/dist/web-extension-esm/register-65800ac3.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 +3 -3
- package/dist/browser-cjs/index-cb4d4017.js.map +0 -1
- package/dist/cordova/popup_redirect-66dd494e.js.map +0 -1
- package/dist/esm/index-9d184c40.js.map +0 -1
- package/dist/node/totp-90def736.js.map +0 -1
- package/dist/node-esm/totp-5d40279f.js.map +0 -1
- package/dist/rn/index-d963ed8d.js.map +0 -1
- package/dist/web-extension-cjs/register-5aa6f443.js.map +0 -1
- package/dist/web-extension-esm/register-01796967.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>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SDK_VERSION, _isFirebaseServerApp, _getProvider, _registerComponent, registerVersion, getApp } from '@firebase/app';
|
|
2
|
-
import { ErrorFactory, isBrowserExtension, isMobileCordova, isReactNative, FirebaseError, querystring, isCloudflareWorker, isCloudWorkstation, getModularInstance, base64Decode, getUA, isIE, createSubscribe, deepEqual, pingServer, querystringDecode, extractQuerystring, isEmpty, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
|
|
2
|
+
import { ErrorFactory, isBrowserExtension, isMobileCordova, isReactNative, FirebaseError, querystring, isCloudflareWorker, isCloudWorkstation, getModularInstance, base64Decode, getUA, isIE, createSubscribe, Deferred, deepEqual, pingServer, querystringDecode, extractQuerystring, isEmpty, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
|
|
3
3
|
import { Logger, LogLevel } from '@firebase/logger';
|
|
4
4
|
import { Component } from '@firebase/component';
|
|
5
5
|
|
|
@@ -903,8 +903,8 @@ async function _performApiRequest(auth, method, path, request, customErrorMap =
|
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
const query = querystring({
|
|
906
|
-
|
|
907
|
-
|
|
906
|
+
...params,
|
|
907
|
+
key: auth.config.apiKey
|
|
908
908
|
}).slice(1);
|
|
909
909
|
const headers = await auth._getAdditionalHeaders();
|
|
910
910
|
headers["Content-Type" /* HttpHeader.CONTENT_TYPE */] = 'application/json';
|
|
@@ -921,7 +921,7 @@ async function _performApiRequest(auth, method, path, request, customErrorMap =
|
|
|
921
921
|
'RequestInitializerDict' is not implemented."
|
|
922
922
|
https://github.com/cloudflare/next-on-pages/issues/487 */
|
|
923
923
|
if (!isCloudflareWorker()) {
|
|
924
|
-
fetchArgs.referrerPolicy = '
|
|
924
|
+
fetchArgs.referrerPolicy = 'strict-origin-when-cross-origin';
|
|
925
925
|
}
|
|
926
926
|
if (auth.emulatorConfig && isCloudWorkstation(auth.emulatorConfig.host)) {
|
|
927
927
|
fetchArgs.credentials = 'include';
|
|
@@ -3429,6 +3429,7 @@ function generateRandomAlphaNumericString(len) {
|
|
|
3429
3429
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
3430
3430
|
const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = 'recaptcha-enterprise';
|
|
3431
3431
|
const FAKE_TOKEN = 'NO_RECAPTCHA';
|
|
3432
|
+
const RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME = 'onFirebaseAuthREInstanceReady';
|
|
3432
3433
|
class RecaptchaEnterpriseVerifier {
|
|
3433
3434
|
/**
|
|
3434
3435
|
*
|
|
@@ -3508,8 +3509,13 @@ class RecaptchaEnterpriseVerifier {
|
|
|
3508
3509
|
}
|
|
3509
3510
|
return new Promise((resolve, reject) => {
|
|
3510
3511
|
retrieveSiteKey(this.auth)
|
|
3511
|
-
.then(siteKey => {
|
|
3512
|
-
if (!forceRefresh &&
|
|
3512
|
+
.then(async (siteKey) => {
|
|
3513
|
+
if (!forceRefresh &&
|
|
3514
|
+
isEnterprise(window.grecaptcha) &&
|
|
3515
|
+
// If download has already been initiated, do not trigger another
|
|
3516
|
+
// download, await the promise here.
|
|
3517
|
+
RecaptchaEnterpriseVerifier.scriptInjectionDeferred) {
|
|
3518
|
+
await RecaptchaEnterpriseVerifier.scriptInjectionDeferred.promise;
|
|
3513
3519
|
retrieveRecaptchaToken(siteKey, resolve, reject);
|
|
3514
3520
|
}
|
|
3515
3521
|
else {
|
|
@@ -3519,9 +3525,25 @@ class RecaptchaEnterpriseVerifier {
|
|
|
3519
3525
|
}
|
|
3520
3526
|
let url = _recaptchaEnterpriseScriptUrl();
|
|
3521
3527
|
if (url.length !== 0) {
|
|
3522
|
-
url +=
|
|
3528
|
+
url +=
|
|
3529
|
+
siteKey +
|
|
3530
|
+
`&onload=${RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME}`;
|
|
3523
3531
|
}
|
|
3532
|
+
// Existence of deferred indicates download has been initiated.
|
|
3533
|
+
RecaptchaEnterpriseVerifier.scriptInjectionDeferred =
|
|
3534
|
+
new Deferred();
|
|
3535
|
+
/**
|
|
3536
|
+
* Script attached to global window object that will be called
|
|
3537
|
+
* when the ReCAPTCHA Enterprise instance is ready.
|
|
3538
|
+
* grecaptcha.ready() is not reliable when there are multiple
|
|
3539
|
+
* scripts on the page, and script.onload only indicates the
|
|
3540
|
+
* script has downloaded, not that it has initialized.
|
|
3541
|
+
*/
|
|
3542
|
+
window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME] = () => {
|
|
3543
|
+
RecaptchaEnterpriseVerifier.scriptInjectionDeferred?.resolve();
|
|
3544
|
+
};
|
|
3524
3545
|
_loadJS(url)
|
|
3546
|
+
.then(() => RecaptchaEnterpriseVerifier.scriptInjectionDeferred?.promise)
|
|
3525
3547
|
.then(() => {
|
|
3526
3548
|
retrieveRecaptchaToken(siteKey, resolve, reject);
|
|
3527
3549
|
})
|
|
@@ -3536,6 +3558,18 @@ class RecaptchaEnterpriseVerifier {
|
|
|
3536
3558
|
});
|
|
3537
3559
|
}
|
|
3538
3560
|
}
|
|
3561
|
+
/**
|
|
3562
|
+
* Deferred that resolves when script tag has been injected onto the page
|
|
3563
|
+
* and the script is ready (grecaptcha.ready() and script.onload are not
|
|
3564
|
+
* reliable indicators, so this resolves when the global
|
|
3565
|
+
* `window[RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME]()` callback provided to the recaptcha url param "onload"
|
|
3566
|
+
* is triggered).
|
|
3567
|
+
* As a static variable this is applied to all instances of the class.
|
|
3568
|
+
* This will cause an error if users try to create multiple RecaptchaVerifiers
|
|
3569
|
+
* with different Recaptcha Enterprise sitekeys, which should be an
|
|
3570
|
+
* unuspported use case.
|
|
3571
|
+
*/
|
|
3572
|
+
RecaptchaEnterpriseVerifier.scriptInjectionDeferred = null;
|
|
3539
3573
|
async function injectRecaptchaFields(auth, request, action, isCaptchaResp = false, isFakeToken = false) {
|
|
3540
3574
|
const verifier = new RecaptchaEnterpriseVerifier(auth);
|
|
3541
3575
|
let captchaResponse;
|
|
@@ -10905,7 +10939,7 @@ function _isEmptyString(input) {
|
|
|
10905
10939
|
}
|
|
10906
10940
|
|
|
10907
10941
|
var name = "@firebase/auth";
|
|
10908
|
-
var version = "1.13.
|
|
10942
|
+
var version = "1.13.3-20260616165109";
|
|
10909
10943
|
|
|
10910
10944
|
/**
|
|
10911
10945
|
* @license
|
|
@@ -11158,4 +11192,4 @@ _setExternalJSProvider({
|
|
|
11158
11192
|
registerAuth("Browser" /* ClientPlatform.BROWSER */);
|
|
11159
11193
|
|
|
11160
11194
|
export { SAMLAuthProvider as $, ActionCodeOperation as A, useDeviceLanguage as B, updateCurrentUser as C, signOut as D, revokeAccessToken as E, FactorId as F, deleteUser as G, debugErrorMap as H, prodErrorMap as I, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as J, initializeAuth as K, connectAuthEmulator as L, AuthCredential as M, EmailAuthCredential as N, OperationType as O, PhoneAuthProvider as P, OAuthCredential as Q, RecaptchaVerifier as R, SignInMethod as S, TotpMultiFactorGenerator as T, PhoneAuthCredential as U, inMemoryPersistence as V, EmailAuthProvider as W, FacebookAuthProvider as X, GoogleAuthProvider as Y, GithubAuthProvider as Z, OAuthProvider as _, browserCookiePersistence as a, TwitterAuthProvider as a0, signInAnonymously as a1, signInWithCredential as a2, linkWithCredential as a3, reauthenticateWithCredential as a4, signInWithCustomToken as a5, sendPasswordResetEmail as a6, confirmPasswordReset as a7, applyActionCode as a8, checkActionCode as a9, _getProjectConfig as aA, _isIOS7Or8 as aB, _createError as aC, _assert as aD, AuthEventManager as aE, _getInstance as aF, _persistenceKeyName as aG, _getRedirectResult as aH, _overrideRedirectResult as aI, _clearRedirectOutcomes as aJ, _castAuth as aK, UserImpl as aL, AuthImpl as aM, _getClientVersion as aN, _generateEventId as aO, AuthPopup as aP, FetchProvider as aQ, SAMLAuthCredential as aR, verifyPasswordResetCode as aa, createUserWithEmailAndPassword as ab, signInWithEmailAndPassword as ac, sendSignInLinkToEmail as ad, isSignInWithEmailLink as ae, signInWithEmailLink as af, fetchSignInMethodsForEmail as ag, sendEmailVerification as ah, verifyBeforeUpdateEmail as ai, ActionCodeURL as aj, parseActionCodeURL as ak, updateProfile as al, updateEmail as am, updatePassword as an, getIdToken as ao, getIdTokenResult as ap, unlink as aq, getAdditionalUserInfo as ar, reload as as, getMultiFactorResolver as at, multiFactor as au, debugAssert as av, _isIOS as aw, _isAndroid as ax, _fail as ay, _getRedirectUrl as az, browserLocalPersistence as b, browserSessionPersistence as c, signInWithPopup as d, linkWithPopup as e, reauthenticateWithPopup as f, signInWithRedirect as g, linkWithRedirect as h, indexedDBLocalPersistence as i, reauthenticateWithRedirect as j, getRedirectResult as k, linkWithPhoneNumber as l, browserPopupRedirectResolver as m, PhoneMultiFactorGenerator as n, TotpSecret as o, getAuth as p, ProviderId as q, reauthenticateWithPhoneNumber as r, signInWithPhoneNumber as s, setPersistence as t, updatePhoneNumber as u, initializeRecaptchaConfig as v, validatePassword as w, onIdTokenChanged as x, beforeAuthStateChanged as y, onAuthStateChanged as z };
|
|
11161
|
-
//# sourceMappingURL=index-
|
|
11195
|
+
//# sourceMappingURL=index-627e45d8.js.map
|