@l4yercak3/cli 1.0.3 → 1.0.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/package.json
CHANGED
package/src/commands/login.js
CHANGED
|
@@ -123,10 +123,14 @@ async function handleLogin() {
|
|
|
123
123
|
// Check if already logged in
|
|
124
124
|
if (configManager.isLoggedIn()) {
|
|
125
125
|
const session = configManager.getSession();
|
|
126
|
-
console.log(chalk.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
console.log(chalk.green(' ✅ You are already logged in'));
|
|
127
|
+
if (session.email) {
|
|
128
|
+
console.log(chalk.gray(` Email: ${session.email}`));
|
|
129
|
+
}
|
|
130
|
+
console.log(chalk.gray(` Session expires: ${new Date(session.expiresAt).toLocaleString()}\n`));
|
|
131
|
+
|
|
132
|
+
// Still offer the setup wizard
|
|
133
|
+
await promptSetupWizard();
|
|
130
134
|
return;
|
|
131
135
|
}
|
|
132
136
|
|
|
@@ -77,7 +77,7 @@ describe('Login Command', () => {
|
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
describe('handler - already logged in', () => {
|
|
80
|
-
it('shows
|
|
80
|
+
it('shows success message when already logged in', async () => {
|
|
81
81
|
configManager.isLoggedIn.mockReturnValue(true);
|
|
82
82
|
configManager.getSession.mockReturnValue({
|
|
83
83
|
email: 'user@example.com',
|
|
@@ -91,7 +91,7 @@ describe('Login Command', () => {
|
|
|
91
91
|
expect(open).not.toHaveBeenCalled();
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
it('
|
|
94
|
+
it('shows session info and offers setup wizard when already logged in', async () => {
|
|
95
95
|
configManager.isLoggedIn.mockReturnValue(true);
|
|
96
96
|
configManager.getSession.mockReturnValue({
|
|
97
97
|
email: 'user@example.com',
|
|
@@ -100,7 +100,8 @@ describe('Login Command', () => {
|
|
|
100
100
|
|
|
101
101
|
await loginCommand.handler();
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
// Should show "What's Next" since we're not in a project (mocked)
|
|
104
|
+
expect(consoleOutput.some((line) => line.includes("What's Next"))).toBe(true);
|
|
104
105
|
});
|
|
105
106
|
});
|
|
106
107
|
|