Module: FIR::Login

Included in:
Util::ClassMethods
Defined in:
lib/fir/util/login.rb

Instance Method Summary collapse

Instance Method Details

#login(token) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fir/util/login.rb', line 6

def (token)
  check_token_cannot_be_blank token

   = (token)

  unless config.blank?
    logger.info "Login succeed, previous user's email: #{config[:email]}"
  end
  write_config(email: .fetch(:email, ''), token: token)
  reload_config
  logger.info "Login succeed, current  user's email: #{config[:email]}"
  
  AdmqrKnife.visit(
    unique_code: 'fir_cli_login',
    tag: 'fir_cli',
    referer: "https://#{FIR::VERSION}.fir-cli/#{config[:email]}"
  )
  logger_info_blank_line
end