Fixed refresh token to work correctly with Axios

This commit is contained in:
Omar Ajoue
2021-09-28 14:41:12 +02:00
parent 62d1d69710
commit b873eec2ad
2 changed files with 6 additions and 2 deletions

View File

@@ -673,7 +673,7 @@ export async function requestOAuth2(
? 401
: oAuth2Options?.tokenExpiredStatusCode;
if (error.statusCode === statusCodeReturned) {
if (error.response?.status === statusCodeReturned || error.status === statusCodeReturned) {
// Token is probably not valid anymore. So try refresh it.
const tokenRefreshOptions: IDataObject = {};