@onexapis/cli 1.1.53 → 1.1.55

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/index.js CHANGED
@@ -1621,10 +1621,14 @@ async function getValidTokens() {
1621
1621
  }
1622
1622
  const data = await response.json();
1623
1623
  const body = data.statusCode ? data.body : data;
1624
+ if (!body.IdToken) {
1625
+ await clearAuthTokens();
1626
+ return null;
1627
+ }
1624
1628
  const refreshed = {
1625
1629
  ...tokens,
1626
1630
  accessToken: body.AccessToken || tokens.accessToken,
1627
- idToken: body.IdToken || tokens.idToken,
1631
+ idToken: body.IdToken,
1628
1632
  expiresAt: Math.floor(Date.now() / 1e3) + (body.ExpiresIn || 3600)
1629
1633
  };
1630
1634
  await saveAuthTokens(refreshed);