@insforge/cli 0.1.32 → 0.1.33
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 +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -373,6 +373,11 @@ async function refreshAccessToken(apiUrl) {
|
|
|
373
373
|
saveCredentials(updated);
|
|
374
374
|
return data.access_token;
|
|
375
375
|
} catch {
|
|
376
|
+
if (process.stdout.isTTY) {
|
|
377
|
+
clack2.log.warn("Session expired. Please log in again.");
|
|
378
|
+
const newCreds = await performOAuthLogin(apiUrl);
|
|
379
|
+
return newCreds.access_token;
|
|
380
|
+
}
|
|
376
381
|
throw new AuthError("Failed to refresh token. Run `insforge login` again.");
|
|
377
382
|
}
|
|
378
383
|
}
|