Class: OmniAuth::Strategies::Unsplash
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Unsplash
- Defined in:
- lib/omniauth/strategies/unsplash.rb
Instance Method Summary collapse
Instance Method Details
#authorize_params ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/omniauth/strategies/unsplash.rb', line 39 def super.tap do |params| %w[ scope ].each do |v| if request.params[v] params[v.to_sym] = request.params[v] end end params[:scope] ||= 'public' end end |
#callback_url ⇒ Object
34 35 36 37 |
# File 'lib/omniauth/strategies/unsplash.rb', line 34 def callback_url [:callback_url] || (full_host + script_name + callback_path) end |
#raw_info ⇒ Object
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/omniauth/strategies/unsplash.rb', line 51 def raw_info if [:extra_data] JSON.parse(access_token.get('/me').body) else {} end # TODO: catch correct RateLimiting exception # rescue JSON::ParseError # {} end |