Class: OmniAuth::Strategies::Streamlabs
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Streamlabs
- Defined in:
- lib/omniauth/strategies/streamlabs.rb
Constant Summary collapse
- DEFAULT_SCOPE =
'donations.read'
Instance Method Summary collapse
- #access_token_options ⇒ Object
- #authorize_params ⇒ Object
- #build_access_token ⇒ Object
- #callback_url ⇒ Object
- #raw_info ⇒ Object
Instance Method Details
#access_token_options ⇒ Object
48 49 50 |
# File 'lib/omniauth/strategies/streamlabs.rb', line 48 def ..inject({}) { |h,(k,v)| h[k.to_sym] = v; h } end |
#authorize_params ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/omniauth/strategies/streamlabs.rb', line 57 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] = params[:scope] || DEFAULT_SCOPE end end |
#build_access_token ⇒ Object
42 43 44 45 46 |
# File 'lib/omniauth/strategies/streamlabs.rb', line 42 def build_access_token super.tap do |token| token..merge!() end end |
#callback_url ⇒ Object
52 53 54 55 |
# File 'lib/omniauth/strategies/streamlabs.rb', line 52 def callback_url return [:redirect_uri] unless [:redirect_uri].nil? full_host + script_name + callback_path end |
#raw_info ⇒ Object
38 39 40 |
# File 'lib/omniauth/strategies/streamlabs.rb', line 38 def raw_info @raw_info ||= access_token.get('/api/v1.0/user').parsed end |