Sha256: a014316e31671ae37dea6bcd0d22fbee175de3059de409fe22c28ce875d51ef0

Contents?: true

Size: 459 Bytes

Versions: 43

Compression:

Stored size: 459 Bytes

Contents

# encoding: utf-8

module FIR
  module Login

    def login(token)
      check_token_cannot_be_blank token

      user_info = fetch_user_info(token)

      logger.info "Login succeed, previous user's email: #{config[:email]}" unless config.blank?
      write_config(email: user_info.fetch(:email, ''), token: token)
      reload_config
      logger.info "Login succeed, current  user's email: #{config[:email]}"
      logger_info_blank_line
    end
  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
fir-cli-1.4.5 lib/fir/util/login.rb
fir-cli-1.4.4 lib/fir/util/login.rb
fir-cli-1.4.3 lib/fir/util/login.rb
fir-cli-1.4.2 lib/fir/util/login.rb
fir-cli-1.4.1 lib/fir/util/login.rb
fir-cli-1.4.0 lib/fir/util/login.rb
fir-cli-1.3.9 lib/fir/util/login.rb
fir-cli-1.3.8 lib/fir/util/login.rb
fir-cli-1.3.7 lib/fir/util/login.rb
fir-cli-1.3.6 lib/fir/util/login.rb
fir-cli-1.3.5 lib/fir/util/login.rb
fir-cli-1.3.4 lib/fir/util/login.rb
fir-cli-1.3.3 lib/fir/util/login.rb
fir-cli-1.3.2 lib/fir/util/login.rb
fir-cli-1.3.1 lib/fir/util/login.rb
fir-cli-1.3.0 lib/fir/util/login.rb
fir-cli-1.2.9 lib/fir/util/login.rb
fir-cli-1.2.8 lib/fir/util/login.rb
fir-cli-1.2.7 lib/fir/util/login.rb
fir-cli-1.2.6 lib/fir/util/login.rb