class OmniAuth::Strategies::Mixer

Constants

BLANK_PARAMS
DEFAULT_SCOPE
RAW_INFO_URL
SOCIAL_KEYS

Public Instance Methods

access_token_options() click to toggle source
# File lib/omniauth/strategies/mixer.rb, line 44
def access_token_options
  options.access_token_options.each_with_object({}) do |(key, val), hsh|
    hsh[key.to_sym] = val
    hsh
  end
end
authorize_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/mixer.rb, line 51
def authorize_params
  super.tap do |params|
    options[:authorize_options].each do |key|
      val = request.params[key.to_s]
      params[key] = val unless BLANK_PARAMS.include? val
    end
    params[:scope] ||= DEFAULT_SCOPE
  end
end
build_access_token() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/mixer.rb, line 61
def build_access_token
  super.tap do |token|
    token.options.merge! access_token_options
  end
end
callback_url() click to toggle source
# File lib/omniauth/strategies/mixer.rb, line 67
def callback_url
  return options[:redirect_url] if options.key? :redirect_url
  full_host + script_name + callback_path
end
raw_info() click to toggle source
# File lib/omniauth/strategies/mixer.rb, line 72
def raw_info
  @raw_info ||= access_token.get(RAW_INFO_URL).parsed
end
social_info() click to toggle source
# File lib/omniauth/strategies/mixer.rb, line 76
def social_info
  raw_social = raw_info['social']
  SOCIAL_KEYS.each_with_object({}) do |key, hsh|
    hsh[key.to_sym] = raw_social[key] if raw_social.key? key
    hsh
  end
end
urls_info() click to toggle source
# File lib/omniauth/strategies/mixer.rb, line 84
def urls_info
  {
    Mixer: "http://mixer.com/#{raw_info['channel']['token']}"
  }
end