Class: LighthouseCLI::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/lighthouse_cli.rb

Class Method Summary collapse

Class Method Details

.authenticate!Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/lighthouse_cli.rb', line 28

def authenticate!
  auth_data = Config.token ? Config.token : [Config.username, Config.password]
  auth_data.flatten!
  
  if auth_data.size == 1
    authenticate_by_token(*auth_data)
  else
    authenticate_by_credentials(*auth_data)
  end
end