@onexapis/cli 1.1.52 → 1.1.54
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/cli.js +367 -235
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +365 -233
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1585,10 +1585,14 @@ async function getValidTokens() {
|
|
|
1585
1585
|
}
|
|
1586
1586
|
const data = await response.json();
|
|
1587
1587
|
const body = data.statusCode ? data.body : data;
|
|
1588
|
+
if (!body.IdToken) {
|
|
1589
|
+
await clearAuthTokens();
|
|
1590
|
+
return null;
|
|
1591
|
+
}
|
|
1588
1592
|
const refreshed = {
|
|
1589
1593
|
...tokens,
|
|
1590
1594
|
accessToken: body.AccessToken || tokens.accessToken,
|
|
1591
|
-
idToken: body.IdToken
|
|
1595
|
+
idToken: body.IdToken,
|
|
1592
1596
|
expiresAt: Math.floor(Date.now() / 1e3) + (body.ExpiresIn || 3600)
|
|
1593
1597
|
};
|
|
1594
1598
|
await saveAuthTokens(refreshed);
|