Class: OmniAuth::Strategies::HackClub

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

Constant Summary collapse

PRODUCTION_SITE =
'https://auth.hackclub.com'
STAGING_SITE =
'https://hca.dinosaurbbq.org'

Instance Method Summary collapse

Instance Method Details

#callback_urlObject



56
57
58
# File 'lib/omniauth/strategies/hack_club.rb', line 56

def callback_url
  full_host + callback_path
end

#clientObject



23
24
25
26
# File 'lib/omniauth/strategies/hack_club.rb', line 23

def client
  options.client_options[:site] = options.staging ? STAGING_SITE : PRODUCTION_SITE
  super
end

#identityObject



52
53
54
# File 'lib/omniauth/strategies/hack_club.rb', line 52

def identity
  raw_info['identity'] || {}
end

#raw_infoObject



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

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