Class: FIS::CLI::Commands::Login
- Inherits:
-
FIS::Command
- Object
- FIS::Command
- FIS::CLI::Commands::Login
- Defined in:
- lib/fis/cli/commands/login.rb
Overview
‘auth login` - Requests and adds the user’s authentication credentials
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options) ⇒ Login
constructor
A new instance of Login.
Methods inherited from FIS::Command
#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which
Constructor Details
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fis/cli/commands/login.rb', line 13 def execute # TODO: Allow for token to be set with a flag FIS.ui.newline return FIS.ui.error("You're already logged in. Please run `fis auth logout` to continue.") if logged_in? return FIS.ui.warn('OAuth not available. Please set your token using the `--token` flag.') if remote_ide? @auth_local_server.start FIS.ui.info('Logging into your Flatiron School account...') open_browser! sleep 1 until token_accessible? # TODO: Timeout? FIS.ui.newline FIS.ui.ok("You've successfully logged in.") ensure @auth_local_server.stop end |