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 |
# File 'lib/fir/util/login.rb', line 6 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 |