Class: OmniAuth::Strategies::Bungie

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

Instance Method Summary collapse

Instance Method Details

#clientObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/omniauth/strategies/bungie.rb', line 14

def client
  client_options = options.client_options.merge(
    :connection_opts => {
      :headers => { 'X-API-Key' => options.api_key }
    },
    :redirect_uri => options.redirect_uri
  )

  ::OAuth2::Client.new(
    options.client_id,
    options.client_secret,
    deep_symbolize(client_options)
  )
end

#raw_infoObject



43
44
45
46
47
48
# File 'lib/omniauth/strategies/bungie.rb', line 43

def raw_info
  return @raw_info unless @raw_info.nil?

  @raw_info = access_token.get('/Platform/User/GetCurrentBungieNetUser/').parsed
  @raw_info = (@raw_info['ErrorCode'] == 1) ? @raw_info['Response'] : {}
end