Sha256: 1b0c97835b69ee0090ef8130e77adcffa5035454c3f62fb96a0c45f911927438

Contents?: true

Size: 629 Bytes

Versions: 9

Compression:

Stored size: 629 Bytes

Contents

require 'oauth2'

module ShopappCompany
  extend ActiveSupport::Concern

  def app_info
    @app_info ||= JSON.parse client.request(:get, "/api/company/app_info.json?key=#{info['shoplift_key']}").body
  end

  def client
    @oauth ||= OAuth2::Client.new Rails.configuration.settings['authlift_app_id'],
                                  Rails.configuration.settings['authlift_app_secret'],
                                  site: Rails.configuration.settings['authlift_url']
    @token ||= @oauth.client_credentials.get_token scope: [Rails.configuration.settings['authlift_default_scope'], 'public'].compact.join(' ')
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shopapp-0.77.07 app/models/concerns/shopapp_company.rb
shopapp-0.76.06 app/models/concerns/shopapp_company.rb
shopapp-0.76.05 app/models/concerns/shopapp_company.rb
shopapp-0.76.04 app/models/concerns/shopapp_company.rb
shopapp-0.75.03 app/models/concerns/shopapp_company.rb
shopapp-0.75.02 app/models/concerns/shopapp_company.rb
shopapp-0.73.02 app/models/concerns/shopapp_company.rb
shopapp-0.3.76 app/models/concerns/shopapp_company.rb
shopapp-0.2.75 app/models/concerns/shopapp_company.rb