Class: OmniAuth::Strategies::Pixiv
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Pixiv
- Defined in:
- lib/omniauth/strategies/pixiv.rb
Constant Summary collapse
- RAW_INFO_URL =
'/v1/me?include_email=1&include_profile=1&get_secure_url=1&profile_image_sizes=px_16x16,px_50x50,px_170x170'.freeze
Instance Method Summary collapse
Instance Method Details
#authorize_params ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/omniauth/strategies/pixiv.rb', line 49 def super.tap do |params| # Pass through request_type as part of oauth state parameter. state_with_request_type = "security_token=#{params[:state]},request_type=#{request.params['request_type'] || 'default'}" session['omniauth.state'] = params[:state] = request.params['state'] = state_with_request_type end end |
#callback_url ⇒ Object
41 42 43 |
# File 'lib/omniauth/strategies/pixiv.rb', line 41 def callback_url full_host + script_name + callback_path end |
#client ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/omniauth/strategies/pixiv.rb', line 33 def client ::OAuth2::Client.new(.client_id, .client_secret, deep_symbolize(.)) do |faraday| faraday.request :url_encoded faraday.request :user_agent, [:user_agent] faraday.adapter Faraday.default_adapter end end |
#raw_info ⇒ Object
45 46 47 |
# File 'lib/omniauth/strategies/pixiv.rb', line 45 def raw_info @raw_info ||= access_token.get(RAW_INFO_URL).parsed['response'].first end |