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.2.5 lib/fir/util/login.rb
fir-cli-1.2.4 lib/fir/util/login.rb
fir-cli-1.2.3 lib/fir/util/login.rb