Class: OmniAuth::Strategies::FiveHundredPx

Inherits:
OAuth
  • Object
show all
Defined in:
lib/omniauth/strategies/500px.rb

Instance Method Summary collapse

Instance Method Details

#raw_infoObject

Return info gathered from the flickr.people.getInfo API call



46
47
48
49
50
# File 'lib/omniauth/strategies/500px.rb', line 46

def raw_info
  @raw_info ||= MultiJson.decode(access_token.get('/v1/users.json').body)
rescue ::Errno::ETIMEDOUT
  raise ::Timeout::Error
end

#request_phaseObject



58
59
60
61
# File 'lib/omniauth/strategies/500px.rb', line 58

def request_phase
  options[:authorize_params] = {:perms => options[:scope]} if options[:scope]
  super
end

#user_infoObject

Provide the “Person” portion of the raw_info



54
55
56
# File 'lib/omniauth/strategies/500px.rb', line 54

def 
  @user_info ||= raw_info.nil? ? {} : raw_info["user"]
end