@firebase/app-check 0.11.3 → 0.11.4
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/app-check.d.ts +3 -3
- package/dist/esm/index.esm.js +17 -7
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/client.d.ts +1 -1
- package/dist/esm/src/providers.d.ts +2 -2
- package/dist/esm/src/types.d.ts +1 -1
- package/dist/index.cjs.js +17 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/src/client.d.ts +1 -1
- package/dist/src/providers.d.ts +2 -2
- package/dist/src/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -854,12 +854,14 @@ async function getLimitedUseToken$1(appCheck) {
|
|
|
854
854
|
const { provider } = getStateReference(app);
|
|
855
855
|
if (isDebugMode()) {
|
|
856
856
|
const debugToken = await getDebugToken();
|
|
857
|
-
const
|
|
857
|
+
const request = getExchangeDebugTokenRequest(app, debugToken);
|
|
858
|
+
request.body['limited_use'] = true;
|
|
859
|
+
const { token } = await exchangeToken(request, appCheck.heartbeatServiceProvider);
|
|
858
860
|
return { token };
|
|
859
861
|
}
|
|
860
862
|
else {
|
|
861
863
|
// provider is definitely valid since we ensure AppCheck was activated
|
|
862
|
-
const { token } = await provider.getToken();
|
|
864
|
+
const { token } = await provider.getToken(true /* isLimitedUse */);
|
|
863
865
|
return { token };
|
|
864
866
|
}
|
|
865
867
|
}
|
|
@@ -1055,7 +1057,7 @@ function internalFactory(appCheck) {
|
|
|
1055
1057
|
}
|
|
1056
1058
|
|
|
1057
1059
|
const name = "@firebase/app-check";
|
|
1058
|
-
const version = "0.11.
|
|
1060
|
+
const version = "0.11.4";
|
|
1059
1061
|
|
|
1060
1062
|
/**
|
|
1061
1063
|
* @license
|
|
@@ -1233,7 +1235,7 @@ class ReCaptchaV3Provider {
|
|
|
1233
1235
|
* Returns an App Check token.
|
|
1234
1236
|
* @internal
|
|
1235
1237
|
*/
|
|
1236
|
-
async getToken() {
|
|
1238
|
+
async getToken(isLimitedUse = false) {
|
|
1237
1239
|
throwIfThrottled(this._throttleData);
|
|
1238
1240
|
// Top-level `getToken()` has already checked that App Check is initialized
|
|
1239
1241
|
// and therefore this._app and this._heartbeatServiceProvider are available.
|
|
@@ -1247,7 +1249,11 @@ class ReCaptchaV3Provider {
|
|
|
1247
1249
|
}
|
|
1248
1250
|
let result;
|
|
1249
1251
|
try {
|
|
1250
|
-
|
|
1252
|
+
const request = getExchangeRecaptchaV3TokenRequest(this._app, attestedClaimsToken);
|
|
1253
|
+
if (isLimitedUse) {
|
|
1254
|
+
request.body['limited_use'] = true;
|
|
1255
|
+
}
|
|
1256
|
+
result = await exchangeToken(request, this._heartbeatServiceProvider);
|
|
1251
1257
|
}
|
|
1252
1258
|
catch (e) {
|
|
1253
1259
|
if (e.code?.includes("fetch-status-error" /* AppCheckError.FETCH_STATUS_ERROR */)) {
|
|
@@ -1310,7 +1316,7 @@ class ReCaptchaEnterpriseProvider {
|
|
|
1310
1316
|
* Returns an App Check token.
|
|
1311
1317
|
* @internal
|
|
1312
1318
|
*/
|
|
1313
|
-
async getToken() {
|
|
1319
|
+
async getToken(isLimitedUse = false) {
|
|
1314
1320
|
throwIfThrottled(this._throttleData);
|
|
1315
1321
|
// Top-level `getToken()` has already checked that App Check is initialized
|
|
1316
1322
|
// and therefore this._app and this._heartbeatServiceProvider are available.
|
|
@@ -1324,7 +1330,11 @@ class ReCaptchaEnterpriseProvider {
|
|
|
1324
1330
|
}
|
|
1325
1331
|
let result;
|
|
1326
1332
|
try {
|
|
1327
|
-
|
|
1333
|
+
const request = getExchangeRecaptchaEnterpriseTokenRequest(this._app, attestedClaimsToken);
|
|
1334
|
+
if (isLimitedUse) {
|
|
1335
|
+
request.body['limited_use'] = true;
|
|
1336
|
+
}
|
|
1337
|
+
result = await exchangeToken(request, this._heartbeatServiceProvider);
|
|
1328
1338
|
}
|
|
1329
1339
|
catch (e) {
|
|
1330
1340
|
if (e.code?.includes("fetch-status-error" /* AppCheckError.FETCH_STATUS_ERROR */)) {
|