Class: Pcli::Services::Commands::Login

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/pcli/services/commands/login.rb

Instance Method Summary collapse

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/pcli/services/commands/login.rb', line 9

def call(*)
  if api.token && !prompt.yes?('You are already logged in. Would you like to log out?')
    output.puts('Aborted.')
    return
  end

  authenticate.run(true)

  CommandOutput.continue
end