Sha256: f67841e41191647bc7624fe6b08cf38e328d6ddb69020ca6f4fbc1955967fa2f

Contents?: true

Size: 677 Bytes

Versions: 27

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true
# require 'byebug'

module FIR
  module Login
    def login(token)
      check_token_cannot_be_blank token

      user_info = fetch_user_info(token)

      unless config.blank?
        logger.info "Login succeed, previous user's email: #{config[:email]}"
      end
      write_config(email: user_info.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
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
fir-cli-2.0.22 lib/fir/util/login.rb
fir-cli-2.0.21 lib/fir/util/login.rb
fir-cli-2.0.20 lib/fir/util/login.rb
fir-cli-2.0.19 lib/fir/util/login.rb
fir-cli-2.0.18 lib/fir/util/login.rb
fir-cli-2.0.17 lib/fir/util/login.rb
fir-cli-2.0.16 lib/fir/util/login.rb
fir-cli-2.0.15 lib/fir/util/login.rb
fir-cli-2.0.14 lib/fir/util/login.rb
fir-cli-2.0.13 lib/fir/util/login.rb
fir-cli-2.0.12 lib/fir/util/login.rb
fir-cli-2.0.11 lib/fir/util/login.rb
fir-cli-2.0.10 lib/fir/util/login.rb
fir-cli-2.0.9 lib/fir/util/login.rb
fir-cli-2.0.8 lib/fir/util/login.rb
fir-cli-2.0.7 lib/fir/util/login.rb
fir-cli-2.0.6 lib/fir/util/login.rb
fir-cli-2.0.5 lib/fir/util/login.rb
fir-cli-2.0.4 lib/fir/util/login.rb
fir-cli-2.0.3.3 lib/fir/util/login.rb