Class: OmniAuth::Strategies::Teamwork

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

Instance Method Summary collapse

Instance Method Details

#callback_urlObject



39
40
41
# File 'lib/omniauth/strategies/teamwork.rb', line 39

def callback_url
  options[:redirect_uri] || (full_host + script_name + callback_path)
end

#locationObject



48
49
50
51
# File 'lib/omniauth/strategies/teamwork.rb', line 48

def location
  address = raw_info['address']
  [address['city'], address['state']].join(' ').strip
end

#raw_infoObject



43
44
45
46
# File 'lib/omniauth/strategies/teamwork.rb', line 43

def raw_info
  url = "#{access_token.response.parsed.installation.api_end_point}me.json"
  @raw_info ||= access_token.get(url).parsed.person
end