Class: OmniAuth::Strategies::ProductHunt

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/product_hunt.rb

Constant Summary collapse

DEFAULT_SCOPES =
%w[public private].freeze

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



20
21
22
23
24
25
26
# File 'lib/omniauth/strategies/product_hunt.rb', line 20

def authorize_params
  super.tap do |params|
    scope = params[:scope].to_s.split(/\s+/)
    scope = scope.concat(DEFAULT_SCOPES.reject {|s| scope.include?(s) })
    params[:scope] = scope.join(" ")
  end
end

#callback_urlObject



16
17
18
# File 'lib/omniauth/strategies/product_hunt.rb', line 16

def callback_url
  options[:redirect_uri] || full_host + script_name + callback_path
end

#raw_infoObject



48
49
50
# File 'lib/omniauth/strategies/product_hunt.rb', line 48

def raw_info
  @raw_info ||= deep_symbolize(access_token.get("/v1/me").parsed)
end