Skip to content
Snippets Groups Projects
Select Git revision
  • 566c734ac5fec7e80a96c5fe532b090c43670235
  • main default protected
  • jw_sonar
  • v6.0.0 protected
  • interactive-mode-preference
  • bedran_exercise-list
  • add_route_user
  • Jw_sonar_backup
  • exercise_list_filter
  • assignment_filter
  • add_route_assignments
  • move-to-esm-only
  • 6.0.0-dev
  • Pre-alpha
  • 5.0.0
  • Latest
  • 4.2.0
  • 4.1.1
  • 4.1.0
  • 4.0.1
  • 4.0.0
  • 3.5.0
  • 3.4.2
  • 3.4.1
  • 3.3.0
  • 3.2.3
  • 3.2.2
  • 3.2.0
  • 3.1.2
  • 3.1.1
  • 3.1.0
  • 3.0.1
32 results

AuthLoginCommand.ts

Blame
  • 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();