class OmniAuth::Strategies::Unsplash

Public Instance Methods

authorize_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/unsplash.rb, line 39
def authorize_params
  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() click to toggle source
# File lib/omniauth/strategies/unsplash.rb, line 34
def callback_url
  options[:callback_url] ||
    (full_host + script_name + callback_path)
end
raw_info() click to toggle source
# File lib/omniauth/strategies/unsplash.rb, line 51
def raw_info
  if options[:extra_data]
    JSON.parse(access_token.get('/me').body)
  else
    {}
  end
  # TODO: catch correct RateLimiting exception
  # rescue JSON::ParseError
  #   {}
end