Class: OmniAuth::Strategies::GitHub
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::GitHub
- Defined in:
- lib/omniauth/strategies/github.rb
Instance Method Summary collapse
- #email ⇒ Object
- #email_access_allowed? ⇒ Boolean
- #emails ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
Instance Method Details
#email ⇒ Object
40 41 42 |
# File 'lib/omniauth/strategies/github.rb', line 40 def email raw_info['email'] || (email_access_allowed? ? emails.first : nil) end |
#email_access_allowed? ⇒ Boolean
49 50 51 |
# File 'lib/omniauth/strategies/github.rb', line 49 def email_access_allowed? ['scope'] && !(['scope'] == 'public') end |
#emails ⇒ Object
44 45 46 47 |
# File 'lib/omniauth/strategies/github.rb', line 44 def emails access_token.[:mode] = :query @emails ||= access_token.get('/user/emails').parsed end |
#raw_info ⇒ Object
35 36 37 38 |
# File 'lib/omniauth/strategies/github.rb', line 35 def raw_info access_token.[:mode] = :query @raw_info ||= access_token.get('/user').parsed end |
#request_phase ⇒ Object
12 13 14 |
# File 'lib/omniauth/strategies/github.rb', line 12 def request_phase super end |