UNPKG

@basictech/cli

Version:

Basic CLI for creating & managing your projects

20 lines 704 B
import { AuthService } from '../lib/auth.js'; import { isOnline } from '../lib/platform.js'; import { MESSAGES } from '../lib/constants.js'; export async function LoginCommand() { // Check if online if (!(await isOnline())) { throw new Error(MESSAGES.OFFLINE); } const authService = AuthService.getInstance(); // Check if already logged in const existingToken = await authService.getToken(); if (existingToken) { console.log('Already logged in with a valid token.'); return; } console.log('🔐 Opening browser for login...'); await authService.login(); console.log('✅ Login successful! Hello :)'); } //# sourceMappingURL=login.js.map