Class: OmniAuth::Strategies::Pinterest

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

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject

You can also set these options in the OmniAuth config :authorize_params option.

For example: /auth/facebook?display=popup



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/omniauth/strategies/pinterest.rb', line 35

def authorize_params
  super.tap do |params|
    %w[display scope auth_type].each do |v|
      if request.params[v]
        params[v.to_sym] = request.params[v]
      end
    end

    params[:scope] ||= DEFAULT_SCOPE
  end
end

#callback_urlObject



47
48
49
# File 'lib/omniauth/strategies/pinterest.rb', line 47

def callback_url
  full_host + script_name + callback_path
end

#raw_infoObject



22
23
24
25
# File 'lib/omniauth/strategies/pinterest.rb', line 22

def raw_info
  fields = 'first_name,id,last_name,url,account_type,username,bio,image'
  @raw_info ||= access_token.get("/v1/me/?fields=#{fields}").parsed['data']
end

#request_phaseObject



12
13
14
15
16
# File 'lib/omniauth/strategies/pinterest.rb', line 12

def request_phase
  options[:scope] ||= 'read_public'
  options[:response_type] ||= 'code'
  super
end

#ssl?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/omniauth/strategies/pinterest.rb', line 27

def ssl?
  true
end