bgit-cli 2.0.0 → 2.0.1
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/lib/banner.js +7 -7
- package/lib/token-manager.js +11 -1
- package/package.json +1 -1
package/lib/banner.js
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
module.exports = function showBanner() {
|
|
6
6
|
console.log(`
|
|
7
|
-
\x1b[36m
|
|
8
|
-
\x1b[36m
|
|
9
|
-
\x1b[36m
|
|
10
|
-
\x1b[36m██╔══██╗\x1b[0m
|
|
11
|
-
\x1b[36m██████╔╝\x1b[0m \x1b[
|
|
12
|
-
\x1b[36m╚═════╝\x1b[0m
|
|
13
|
-
|
|
7
|
+
\x1b[36m██╗\x1b[0m \x1b[35m██████╗\x1b[0m \x1b[33m██╗████████╗\x1b[0m
|
|
8
|
+
\x1b[36m██║\x1b[0m \x1b[35m██╔════╝\x1b[0m \x1b[33m██║╚══██╔══╝\x1b[0m
|
|
9
|
+
\x1b[36m██████╗\x1b[0m \x1b[35m██║ ███╗\x1b[0m \x1b[33m██║ ██║\x1b[0m
|
|
10
|
+
\x1b[36m██╔══██╗\x1b[0m \x1b[35m██║ ██║\x1b[0m \x1b[33m██║ ██║\x1b[0m
|
|
11
|
+
\x1b[36m██████╔╝\x1b[0m \x1b[90m=======\x1b[0m \x1b[35m╚██████╔╝\x1b[0m \x1b[33m██║ ██║\x1b[0m
|
|
12
|
+
\x1b[36m╚═════╝\x1b[0m \x1b[35m╚═════╝\x1b[0m \x1b[33m╚═╝ ╚═╝\x1b[0m
|
|
13
|
+
|
|
14
14
|
\x1b[90m> Bitcoin-Native Git Wrapper\x1b[0m
|
|
15
15
|
\x1b[90m> Pay-to-Operate • Universal History\x1b[0m
|
|
16
16
|
`);
|
package/lib/token-manager.js
CHANGED
|
@@ -87,20 +87,30 @@ async function isTokenValid(authToken) {
|
|
|
87
87
|
const account = handCashConnect.getAccountFromAuthToken(authToken);
|
|
88
88
|
|
|
89
89
|
// Try to get profile - this validates the token
|
|
90
|
+
console.log('🔍 DEBUG: Calling HandCash API...');
|
|
90
91
|
const profile = await account.profile.getCurrentProfile();
|
|
92
|
+
console.log('🔍 DEBUG: Profile response:', JSON.stringify(profile, null, 2));
|
|
93
|
+
console.log('🔍 DEBUG: Profile.handle:', profile?.handle);
|
|
91
94
|
|
|
92
95
|
if (profile && profile.handle) {
|
|
93
96
|
// Token is valid
|
|
97
|
+
console.log('✅ DEBUG: Token is valid!');
|
|
94
98
|
setCachedValidation(authToken, true);
|
|
95
99
|
return true;
|
|
96
100
|
} else {
|
|
97
101
|
// Unexpected response
|
|
102
|
+
console.log('❌ DEBUG: Profile missing handle property');
|
|
103
|
+
console.log('❌ DEBUG: Full profile:', profile);
|
|
98
104
|
setCachedValidation(authToken, false);
|
|
99
105
|
return false;
|
|
100
106
|
}
|
|
101
107
|
} catch (error) {
|
|
102
108
|
// Token is invalid or API error
|
|
103
|
-
console.error(
|
|
109
|
+
console.error(`\n🔍 DEBUG: Token validation failed`);
|
|
110
|
+
console.error(`Error message: ${error.message}`);
|
|
111
|
+
console.error(`Error stack: ${error.stack}`);
|
|
112
|
+
console.error(`Auth token length: ${authToken?.length}`);
|
|
113
|
+
console.error(`Auth token preview: ${authToken?.substring(0, 20)}...\n`);
|
|
104
114
|
setCachedValidation(authToken, false);
|
|
105
115
|
return false;
|
|
106
116
|
}
|