devwing 0.1.11 → 0.1.12
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 +17 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2935,6 +2935,10 @@ var InteractiveSession = class {
|
|
|
2935
2935
|
console.log(
|
|
2936
2936
|
` ${chalk7.bold("Auth")} ${chalk7.green("\u25CF")} ${name} ${planColor(`(${plan})`)}`
|
|
2937
2937
|
);
|
|
2938
|
+
} else if (this.isAuthenticated) {
|
|
2939
|
+
console.log(
|
|
2940
|
+
` ${chalk7.bold("Auth")} ${chalk7.green("\u25CF")} Authenticated ${chalk7.dim("(offline)")}`
|
|
2941
|
+
);
|
|
2938
2942
|
} else {
|
|
2939
2943
|
console.log(
|
|
2940
2944
|
` ${chalk7.bold("Auth")} ${chalk7.red("\u25CF")} Not logged in ${chalk7.dim("\u2014 type /login")}`
|
|
@@ -2997,14 +3001,22 @@ var InteractiveSession = class {
|
|
|
2997
3001
|
async checkAuthStatus() {
|
|
2998
3002
|
try {
|
|
2999
3003
|
const apiKey = await configManager.getApiKey();
|
|
3000
|
-
if (apiKey) {
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3004
|
+
if (!apiKey) {
|
|
3005
|
+
this.isAuthenticated = false;
|
|
3006
|
+
this.userProfile = null;
|
|
3007
|
+
return;
|
|
3008
|
+
}
|
|
3009
|
+
if (this.isDemo) {
|
|
3010
|
+
this.isAuthenticated = true;
|
|
3011
|
+
this.userProfile = { ...DEMO_USER2 };
|
|
3012
|
+
} else {
|
|
3013
|
+
try {
|
|
3005
3014
|
const profile = await apiClient.getProfile();
|
|
3006
3015
|
this.isAuthenticated = true;
|
|
3007
3016
|
this.userProfile = profile;
|
|
3017
|
+
} catch {
|
|
3018
|
+
this.isAuthenticated = true;
|
|
3019
|
+
this.userProfile = null;
|
|
3008
3020
|
}
|
|
3009
3021
|
}
|
|
3010
3022
|
} catch {
|