@telelabsai/ship 1.1.8 → 1.1.10
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/cli/commands/auth.js +9 -0
- package/package.json +1 -1
package/cli/commands/auth.js
CHANGED
|
@@ -14,6 +14,15 @@ const DASHBOARD_URL = process.env.SHIP_DASHBOARD_URL || 'http://localhost:3000';
|
|
|
14
14
|
* ship auth login — open browser to authorize CLI
|
|
15
15
|
*/
|
|
16
16
|
function login() {
|
|
17
|
+
// Check if already authenticated
|
|
18
|
+
const existing = loadCredentials();
|
|
19
|
+
if (existing?.token) {
|
|
20
|
+
console.log(` Already authenticated as ${existing.user?.name || existing.user?.email || 'user'}.`);
|
|
21
|
+
console.log(` Token: ${existing.token.slice(0, 12)}••••••`);
|
|
22
|
+
console.log(' Run: ship auth logout to re-authenticate.\n');
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
console.log(' Opening browser to authorize Ship CLI...\n');
|
|
18
27
|
|
|
19
28
|
// Start a local HTTP server to receive the callback
|