Class: OmniAuth::Strategies::Everyplay

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

Constant Summary collapse

DEFAULT_SCOPE =
'basic'

Instance Method Summary collapse

Instance Method Details

#access_token_optionsObject



55
56
57
# File 'lib/omniauth/strategies/everyplay.rb', line 55

def access_token_options
  options.access_token_options.inject({}) { |h,(k,v)| h[k.to_sym] = v; h }
end

#authorize_paramsObject



59
60
61
62
63
64
# File 'lib/omniauth/strategies/everyplay.rb', line 59

def authorize_params
  super.tap do |params|
    %w[display state scope].each { |v| params[v.to_sym] = request.params[v] if request.params[v] }
    params[:scope] ||= DEFAULT_SCOPE
  end
end

#build_access_tokenObject



49
50
51
52
53
# File 'lib/omniauth/strategies/everyplay.rb', line 49

def build_access_token
  super.tap do |token|
    token.options.merge!(access_token_options)
  end
end

#raw_infoObject



45
46
47
# File 'lib/omniauth/strategies/everyplay.rb', line 45

def raw_info
  @raw_info ||= access_token.get('/me').parsed
end