Class: OmniAuth::Strategies::Patreon
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Patreon
- Defined in:
- lib/j1_app/omniauth/strategies/patreon.rb
Constant Summary collapse
- DEFAULT_SCOPE =
OAuth client settings
'users, pledges-to-me'
Instance Method Summary collapse
Instance Method Details
#authorize_params ⇒ Object
75 76 77 78 79 80 81 82 83 |
# File 'lib/j1_app/omniauth/strategies/patreon.rb', line 75 def super.tap do |params| [:authorize_options].each do |k| params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s]) end params[:scope] = get_scope(params) session['omniauth.state'] = params[:state] if params[:state] end end |
#callback_url ⇒ Object
43 44 45 |
# File 'lib/j1_app/omniauth/strategies/patreon.rb', line 43 def callback_url [:redirect_uri] || full_host + script_name + callback_path end |
#raw_info ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/j1_app/omniauth/strategies/patreon.rb', line 91 def raw_info @raw_info ||= begin response = client.request( :get, 'https://api.patreon.com/oauth2/api/current_user', headers: { 'Authorization' => "Bearer #{access_token.token}" }, parse: :json ) response.parsed end end |