Class: OmniAuth::Strategies::Tapjoy

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.authorize_pathObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/omniauth/strategies/tapjoy.rb', line 27

def self.authorize_path
  if ENV['TAPJOY_AUTH_PATH']
    ENV['TAPJOY_AUTH_PATH'] 
  elsif ENV['TAPJOY_AUTH_ENV'] == 'staging'
    # Staging path is currently the same as production
    "/oauth/authorize"
  else
    "/oauth/authorize"
  end
end

.reconfigureObject

If you overwrite ENV settings in your application, for example in a rails environment setup, you will have to call OmniAuth::Strategies::Tapjoy.reconfigure to propagate your changes.



10
11
12
13
14
15
# File 'lib/omniauth/strategies/tapjoy.rb', line 10

def self.reconfigure
  option :client_options, {
    :site => site,
    :authorize_path => authorize_path
  }
end

.siteObject



17
18
19
20
21
22
23
24
25
# File 'lib/omniauth/strategies/tapjoy.rb', line 17

def self.site
  if ENV['TAPJOY_AUTH_SITE']
    ENV['TAPJOY_AUTH_SITE']
  elsif ENV['TAPJOY_AUTH_ENV'] == 'staging'
    'https://mystique-staging.herokuapp.com'
  else
    "https://oauth.tapjoy.com"
  end
end

Instance Method Details

#raw_infoObject



46
47
48
# File 'lib/omniauth/strategies/tapjoy.rb', line 46

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