@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/Api.d.ts
CHANGED
|
@@ -57,7 +57,6 @@ export declare class Api extends EventEmitter {
|
|
|
57
57
|
protected readonly http: HttpClient;
|
|
58
58
|
private readonly wsUrl;
|
|
59
59
|
private readonly urlPath;
|
|
60
|
-
private refreshingToken;
|
|
61
60
|
constructor({ url, wsUrl, wsKeepAlive, snappingHubUrl, http, urlPath, httpOptions, }: ApiParams);
|
|
62
61
|
get isShared(): boolean;
|
|
63
62
|
get isPresentation(): boolean;
|
package/dist/api.esm.js
CHANGED
|
@@ -2783,11 +2783,9 @@ class Api extends EventEmitter {
|
|
|
2783
2783
|
http;
|
|
2784
2784
|
wsUrl;
|
|
2785
2785
|
urlPath;
|
|
2786
|
-
refreshingToken;
|
|
2787
2786
|
constructor({ url, wsUrl, wsKeepAlive, snappingHubUrl, http, urlPath, httpOptions, }) {
|
|
2788
2787
|
super();
|
|
2789
2788
|
const { hooks } = httpOptions || {};
|
|
2790
|
-
this.refreshingToken = false;
|
|
2791
2789
|
this.http =
|
|
2792
2790
|
http ||
|
|
2793
2791
|
new HttpClient({
|
|
@@ -2818,8 +2816,7 @@ class Api extends EventEmitter {
|
|
|
2818
2816
|
case 401:
|
|
2819
2817
|
try {
|
|
2820
2818
|
const refreshToken = window.localStorage.getItem(STORAGE_REFRESH_TOKEN_KEY);
|
|
2821
|
-
if (
|
|
2822
|
-
this.refreshingToken = true;
|
|
2819
|
+
if (refreshToken) {
|
|
2823
2820
|
const refreshTokenResponse = await this.account.refreshToken({
|
|
2824
2821
|
refreshToken,
|
|
2825
2822
|
});
|
|
@@ -2828,7 +2825,6 @@ class Api extends EventEmitter {
|
|
|
2828
2825
|
window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, refreshTokenResponse.refreshToken);
|
|
2829
2826
|
}
|
|
2830
2827
|
request.headers?.set("Authorization", `Bearer ${refreshTokenResponse.token || ""}`);
|
|
2831
|
-
this.refreshingToken = false;
|
|
2832
2828
|
}
|
|
2833
2829
|
}
|
|
2834
2830
|
catch (error) {
|