@evergis/api 4.1.51 → 4.1.52
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/Api.d.ts +0 -1
- package/dist/api.esm.js +1 -5
- package/dist/api.esm.js.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2784,11 +2784,9 @@ class Api extends EventEmitter {
|
|
|
2784
2784
|
http;
|
|
2785
2785
|
wsUrl;
|
|
2786
2786
|
urlPath;
|
|
2787
|
-
refreshingToken;
|
|
2788
2787
|
constructor({ url, wsUrl, wsKeepAlive, snappingHubUrl, http, urlPath, httpOptions, }) {
|
|
2789
2788
|
super();
|
|
2790
2789
|
const { hooks } = httpOptions || {};
|
|
2791
|
-
this.refreshingToken = false;
|
|
2792
2790
|
this.http =
|
|
2793
2791
|
http ||
|
|
2794
2792
|
new HttpClient({
|
|
@@ -2819,8 +2817,7 @@ class Api extends EventEmitter {
|
|
|
2819
2817
|
case 401:
|
|
2820
2818
|
try {
|
|
2821
2819
|
const refreshToken = window.localStorage.getItem(STORAGE_REFRESH_TOKEN_KEY);
|
|
2822
|
-
if (
|
|
2823
|
-
this.refreshingToken = true;
|
|
2820
|
+
if (refreshToken) {
|
|
2824
2821
|
const refreshTokenResponse = await this.account.refreshToken({
|
|
2825
2822
|
refreshToken,
|
|
2826
2823
|
});
|
|
@@ -2829,7 +2826,6 @@ class Api extends EventEmitter {
|
|
|
2829
2826
|
window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, refreshTokenResponse.refreshToken);
|
|
2830
2827
|
}
|
|
2831
2828
|
request.headers?.set("Authorization", `Bearer ${refreshTokenResponse.token || ""}`);
|
|
2832
|
-
this.refreshingToken = false;
|
|
2833
2829
|
}
|
|
2834
2830
|
}
|
|
2835
2831
|
catch (error) {
|