@askance/cli 0.2.3 → 0.2.4
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/index.js +6 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -339,8 +339,12 @@ async function setupProject() {
|
|
|
339
339
|
const projectsResult = await (0, api_client_1.apiGet)("/api/projects");
|
|
340
340
|
if (!projectsResult.ok || !projectsResult.data) {
|
|
341
341
|
if (projectsResult.status === 401) {
|
|
342
|
-
console.log(" Session expired.
|
|
343
|
-
|
|
342
|
+
console.log(" Session expired. Clearing credentials...");
|
|
343
|
+
const credPath = path_1.default.join(projectDir, ".askance", "credentials");
|
|
344
|
+
if (fs_1.default.existsSync(credPath))
|
|
345
|
+
fs_1.default.unlinkSync(credPath);
|
|
346
|
+
(0, api_client_1.clearConfigCache)();
|
|
347
|
+
console.log(" Please run: npx askance login");
|
|
344
348
|
}
|
|
345
349
|
else {
|
|
346
350
|
console.log(` Could not fetch projects (${projectsResult.error ?? `HTTP ${projectsResult.status}`}).`);
|