@auth0/auth0-spa-js 2.11.0 → 2.11.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 +9 -1
- 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/auth0-spa-js.worker.development.js.map +1 -1
- package/dist/auth0-spa-js.worker.production.js.map +1 -1
- package/dist/lib/auth0-spa-js.cjs.js +9 -1
- package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
- package/dist/typings/global.d.ts +4 -1
- package/dist/typings/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/Auth0Client.ts +13 -0
- package/src/global.ts +4 -1
- package/src/version.ts +1 -1
|
@@ -540,7 +540,7 @@
|
|
|
540
540
|
exports.default = SuperTokensLock;
|
|
541
541
|
}));
|
|
542
542
|
var Lock = unwrapExports(browserTabsLock);
|
|
543
|
-
var version = "2.11.
|
|
543
|
+
var version = "2.11.1";
|
|
544
544
|
const DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS = 60;
|
|
545
545
|
const DEFAULT_POPUP_CONFIG_OPTIONS = {
|
|
546
546
|
timeoutInSeconds: DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS
|
|
@@ -2808,6 +2808,7 @@
|
|
|
2808
2808
|
}
|
|
2809
2809
|
}
|
|
2810
2810
|
async _requestToken(options, additionalParameters) {
|
|
2811
|
+
var _a, _b;
|
|
2811
2812
|
const {nonceIn: nonceIn, organization: organization, scopesToRequest: scopesToRequest} = additionalParameters || {};
|
|
2812
2813
|
const authResult = await oauthToken(Object.assign(Object.assign({
|
|
2813
2814
|
baseUrl: this.domainUrl,
|
|
@@ -2821,6 +2822,13 @@
|
|
|
2821
2822
|
scope: scopesToRequest || options.scope
|
|
2822
2823
|
}), this.worker);
|
|
2823
2824
|
const decodedToken = await this._verifyIdToken(authResult.id_token, nonceIn, organization);
|
|
2825
|
+
if (options.grant_type === "authorization_code") {
|
|
2826
|
+
const existingIdToken = await this._getIdTokenFromCache();
|
|
2827
|
+
if (((_b = (_a = existingIdToken === null || existingIdToken === void 0 ? void 0 : existingIdToken.decodedToken) === null || _a === void 0 ? void 0 : _a.claims) === null || _b === void 0 ? void 0 : _b.sub) && existingIdToken.decodedToken.claims.sub !== decodedToken.claims.sub) {
|
|
2828
|
+
await this.cacheManager.clear(this.options.clientId);
|
|
2829
|
+
this.userCache.remove(CACHE_KEY_ID_TOKEN_SUFFIX);
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2824
2832
|
await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({}, authResult), {
|
|
2825
2833
|
decodedToken: decodedToken,
|
|
2826
2834
|
scope: options.scope,
|