rest-client-sdk 7.0.3 → 7.1.0
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/README.md +3 -0
- package/dist/index.es.js +11 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/types/RestClientSdkInterface.d.ts +1 -0
- package/package.json +1 -1
- package/src/RestClientSdkInterface.ts +1 -0
- package/src/TokenStorage.ts +1 -1
- package/src/client/AbstractClient.ts +23 -10
package/dist/index.js
CHANGED
|
@@ -1332,6 +1332,16 @@
|
|
|
1332
1332
|
});
|
|
1333
1333
|
|
|
1334
1334
|
return _this4._fetchWithToken(input, updatedRequestParams);
|
|
1335
|
+
})["catch"](function (e) {
|
|
1336
|
+
if (e instanceof OauthError) {
|
|
1337
|
+
_classPrivateFieldGet(_this4, _tokenStorage).logout().then(function () {
|
|
1338
|
+
if (_this4.sdk.config.onRefreshTokenFailure) {
|
|
1339
|
+
_this4.sdk.config.onRefreshTokenFailure(e);
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
throw e;
|
|
1335
1345
|
});
|
|
1336
1346
|
}
|
|
1337
1347
|
}, {
|
|
@@ -2951,7 +2961,7 @@
|
|
|
2951
2961
|
return response.json().then(function (body) {
|
|
2952
2962
|
if (isOauthError(body)) {
|
|
2953
2963
|
// throw error if response body is an oauth error
|
|
2954
|
-
manageOauthError(body,
|
|
2964
|
+
manageOauthError(body, originalResponse);
|
|
2955
2965
|
} else if (response.status >= 400) {
|
|
2956
2966
|
// throw an error if response status code is an "error" status code
|
|
2957
2967
|
throw getHttpErrorFromResponse(originalResponse);
|