Class: LighthouseCLI::Authenticator

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

Class Method Summary collapse

Class Method Details

.authenticate!Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/lighthouse_cli/authenticator.rb', line 4

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