@auth0/auth0-spa-js 2.19.0 → 2.19.1
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/auth0-spa-js.development.js +38 -24
- package/dist/auth0-spa-js.development.js.map +1 -1
- package/dist/auth0-spa-js.production.esm.js +1 -1
- package/dist/auth0-spa-js.production.esm.js.map +1 -1
- package/dist/auth0-spa-js.production.js +1 -1
- package/dist/auth0-spa-js.production.js.map +1 -1
- package/dist/lib/auth0-spa-js.cjs.js +38 -24
- package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
- package/dist/typings/Auth0Client.d.ts +476 -476
- package/dist/typings/Auth0Client.utils.d.ts +90 -90
- package/dist/typings/MyAccountApiClient.d.ts +92 -92
- package/dist/typings/TokenExchange.d.ts +77 -77
- package/dist/typings/api.d.ts +33 -33
- package/dist/typings/cache/cache-localstorage.d.ts +7 -7
- package/dist/typings/cache/cache-manager.d.ts +69 -69
- package/dist/typings/cache/cache-memory.d.ts +4 -4
- package/dist/typings/cache/index.d.ts +4 -4
- package/dist/typings/cache/key-manifest.d.ts +12 -12
- package/dist/typings/cache/shared.d.ts +68 -68
- package/dist/typings/constants.d.ts +58 -58
- package/dist/typings/dpop/dpop.d.ts +17 -17
- package/dist/typings/dpop/storage.d.ts +27 -27
- package/dist/typings/dpop/utils.d.ts +15 -15
- package/dist/typings/errors.d.ts +96 -96
- package/dist/typings/fetcher.d.ts +54 -54
- package/dist/typings/global.d.ts +826 -826
- package/dist/typings/http.d.ts +11 -11
- package/dist/typings/index.d.ts +24 -24
- package/dist/typings/jwt.d.ts +21 -21
- package/dist/typings/lock.d.ts +32 -32
- package/dist/typings/mfa/MfaApiClient.d.ts +225 -225
- package/dist/typings/mfa/MfaContextManager.d.ts +79 -79
- package/dist/typings/mfa/constants.d.ts +23 -23
- package/dist/typings/mfa/errors.d.ts +117 -117
- package/dist/typings/mfa/index.d.ts +4 -4
- package/dist/typings/mfa/types.d.ts +181 -181
- package/dist/typings/mfa/utils.d.ts +23 -23
- package/dist/typings/promise-utils.d.ts +2 -2
- package/dist/typings/scope.d.ts +35 -35
- package/dist/typings/storage.d.ts +26 -26
- package/dist/typings/transaction-manager.d.ts +33 -33
- package/dist/typings/utils.d.ts +36 -36
- package/dist/typings/version.d.ts +2 -2
- package/dist/typings/worker/token.worker.d.ts +1 -1
- package/dist/typings/worker/worker.types.d.ts +27 -27
- package/dist/typings/worker/worker.utils.d.ts +13 -13
- package/package.json +1 -1
- package/src/api.ts +15 -11
- package/src/cache/cache-manager.ts +28 -9
- package/src/version.ts +1 -1
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
var e = new Error(message);
|
|
16
16
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
17
17
|
};
|
|
18
|
-
var version = "2.19.
|
|
18
|
+
var version = "2.19.1";
|
|
19
19
|
const DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS = 60;
|
|
20
20
|
const DEFAULT_POPUP_CONFIG_OPTIONS = {
|
|
21
21
|
timeoutInSeconds: DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS
|
|
@@ -1350,20 +1350,24 @@
|
|
|
1350
1350
|
token_type_hint: token_type_hint
|
|
1351
1351
|
};
|
|
1352
1352
|
const body = useFormData ? createQueryParams(baseParams) : JSON.stringify(baseParams);
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1353
|
+
try {
|
|
1354
|
+
return await sendMessage({
|
|
1355
|
+
type: "revoke",
|
|
1356
|
+
timeout: resolvedTimeout,
|
|
1357
|
+
fetchUrl: fetchUrl,
|
|
1358
|
+
fetchOptions: {
|
|
1359
|
+
method: "POST",
|
|
1360
|
+
body: body,
|
|
1361
|
+
headers: headers
|
|
1362
|
+
},
|
|
1363
|
+
useFormData: useFormData,
|
|
1364
|
+
auth: {
|
|
1365
|
+
audience: audience !== null && audience !== void 0 ? audience : DEFAULT_AUDIENCE
|
|
1366
|
+
}
|
|
1367
|
+
}, worker);
|
|
1368
|
+
} catch (e) {
|
|
1369
|
+
throw new GenericError("revoke_error", e.message);
|
|
1370
|
+
}
|
|
1367
1371
|
}
|
|
1368
1372
|
for (const refreshToken of refreshTokens) {
|
|
1369
1373
|
const params = {
|
|
@@ -1546,12 +1550,14 @@
|
|
|
1546
1550
|
let cacheMode = arguments.length > 3 ? arguments[3] : undefined;
|
|
1547
1551
|
var _a;
|
|
1548
1552
|
let wrappedEntry = await this.cache.get(cacheKey.toKey());
|
|
1553
|
+
let resolvedCacheKey = cacheKey;
|
|
1549
1554
|
if (!wrappedEntry) {
|
|
1550
1555
|
const keys = await this.getCacheKeys();
|
|
1551
1556
|
if (!keys) return;
|
|
1552
1557
|
const matchedKey = this.matchExistingCacheKey(cacheKey, keys);
|
|
1553
1558
|
if (matchedKey) {
|
|
1554
1559
|
wrappedEntry = await this.cache.get(matchedKey);
|
|
1560
|
+
resolvedCacheKey = CacheKey.fromKey(matchedKey);
|
|
1555
1561
|
}
|
|
1556
1562
|
if (!wrappedEntry && useMrrt && cacheMode !== "cache-only") {
|
|
1557
1563
|
return this.getEntryWithRefreshToken(cacheKey, keys);
|
|
@@ -1564,25 +1570,29 @@
|
|
|
1564
1570
|
const nowSeconds = Math.floor(now / 1e3);
|
|
1565
1571
|
if (wrappedEntry.expiresAt - expiryAdjustmentSeconds < nowSeconds) {
|
|
1566
1572
|
if (wrappedEntry.body.refresh_token) {
|
|
1567
|
-
return this.modifiedCachedEntry(wrappedEntry,
|
|
1573
|
+
return this.modifiedCachedEntry(wrappedEntry, resolvedCacheKey);
|
|
1568
1574
|
}
|
|
1569
|
-
await this.cache.remove(
|
|
1570
|
-
await ((_a = this.keyManifest) === null || _a === void 0 ? void 0 : _a.remove(
|
|
1575
|
+
await this.cache.remove(resolvedCacheKey.toKey());
|
|
1576
|
+
await ((_a = this.keyManifest) === null || _a === void 0 ? void 0 : _a.remove(resolvedCacheKey.toKey()));
|
|
1571
1577
|
return;
|
|
1572
1578
|
}
|
|
1573
1579
|
return wrappedEntry.body;
|
|
1574
1580
|
}
|
|
1575
1581
|
async modifiedCachedEntry(wrappedEntry, cacheKey) {
|
|
1576
|
-
|
|
1582
|
+
const strippedBody = {
|
|
1577
1583
|
refresh_token: wrappedEntry.body.refresh_token,
|
|
1578
1584
|
audience: wrappedEntry.body.audience,
|
|
1579
1585
|
scope: wrappedEntry.body.scope
|
|
1580
1586
|
};
|
|
1581
|
-
|
|
1587
|
+
const strippedEntry = {
|
|
1588
|
+
body: strippedBody,
|
|
1589
|
+
expiresAt: wrappedEntry.expiresAt
|
|
1590
|
+
};
|
|
1591
|
+
await this.cache.set(cacheKey.toKey(), strippedEntry);
|
|
1582
1592
|
return {
|
|
1583
|
-
refresh_token:
|
|
1584
|
-
audience:
|
|
1585
|
-
scope:
|
|
1593
|
+
refresh_token: strippedBody.refresh_token,
|
|
1594
|
+
audience: strippedBody.audience,
|
|
1595
|
+
scope: strippedBody.scope
|
|
1586
1596
|
};
|
|
1587
1597
|
}
|
|
1588
1598
|
async set(entry) {
|
|
@@ -1664,7 +1674,11 @@
|
|
|
1664
1674
|
if (cacheKey.prefix === CACHE_KEY_PREFIX && cacheKey.clientId === keyToMatch.clientId) {
|
|
1665
1675
|
const cachedEntry = await this.cache.get(key);
|
|
1666
1676
|
if ((_a = cachedEntry === null || cachedEntry === void 0 ? void 0 : cachedEntry.body) === null || _a === void 0 ? void 0 : _a.refresh_token) {
|
|
1667
|
-
return
|
|
1677
|
+
return {
|
|
1678
|
+
refresh_token: cachedEntry.body.refresh_token,
|
|
1679
|
+
audience: cachedEntry.body.audience,
|
|
1680
|
+
scope: cachedEntry.body.scope
|
|
1681
|
+
};
|
|
1668
1682
|
}
|
|
1669
1683
|
}
|
|
1670
1684
|
}
|