Select Git revision
AuthLoginCommand.ts

michael.minelli authored
AuthLoginCommand.ts 870 B
import CommanderCommand from '../../CommanderCommand.js';
import SessionManager from '../../../managers/SessionManager.js';
import TextStyle from '../../../types/TextStyle.js';
class AuthLoginCommand extends CommanderCommand {
protected commandName: string = 'login';
protected defineCommand() {
this.command
.description('login to Dojo')
.option('-c, --cli', 'proceed to the login in headless mode (do not try to open web browser).')
.action(this.commandAction.bind(this));
}
protected async commandAction(options: { cli: boolean }): Promise<void> {
try {
console.log(TextStyle.BLOCK('Please wait while we login you into Dojo...'));
await SessionManager.login(options.cli);
} catch ( error ) { /* empty */ }
}
}
export default new AuthLoginCommand();