Skip to content

Commit

Permalink
Review comment addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Jithesh-poojary committed Feb 23, 2024
1 parent a84be6c commit 0e7e82a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Conductor/Client/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,9 @@ private RestResponse RetryRestClientCallApi(String path, Method method, List<Key
RestResponse response = null;
while (retryCount < Constants.MAX_TOKEN_REFRESH_RETRY_COUNT)
{
bool isTokenRefreshed = false; // reset refreshStatusflag

var request = PrepareRequest(
path, method, queryParams, postBody, headerParams, formParams, fileParams,
pathParams, contentType);
path, method, queryParams, postBody, headerParams, formParams, fileParams,
pathParams, contentType);

InterceptRequest(request);
response = RestClient.Execute(request, method);
Expand All @@ -199,17 +197,17 @@ private RestResponse RetryRestClientCallApi(String path, Method method, List<Key
{
var JsonContent = JsonConvert.DeserializeObject<JObject>(response.Content);

if (JsonContent["error"].ToString() == "EXPIRED_TOKEN" && retryCount < Constants.MAX_TOKEN_REFRESH_RETRY_COUNT)
if (JsonContent["error"].ToString() == "EXPIRED_TOKEN")
{
string refreshToken = configuration.GetRefreshToken();
headerParams["X-Authorization"] = refreshToken;
isTokenRefreshed = true;
retryCount++;
}
}

if (!isTokenRefreshed)
else
{
break;
}
}
return response;
}
Expand Down

0 comments on commit 0e7e82a

Please sign in to comment.