feat(salesforce): implement refresh token logic

This commit is contained in:
Ali BARIN
2022-11-19 20:28:48 +01:00
parent 901605fd9c
commit 166dda4a4b
3 changed files with 32 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ export default function createHttpClient({
const { config } = error;
const { status } = error.response;
if (status === 401 && $.app.auth.refreshAccessToken && config.additionalProperties.shouldRetry !== false) {
if (status === 401 && $.app.auth.refreshAccessToken && config.additionalProperties?.shouldRetry !== false) {
await $.app.auth.refreshAccessToken($);
// retry the request