Class: OmniAuth::Strategies::AngelList
- Defined in:
- lib/omniauth/strategies/oauth2/angellist.rb
Overview
Authenticate to AngelList utilizing OAuth 2.0 and retrieve basic user information.
Instance Attribute Summary
Attributes inherited from OAuth2
#client_id, #client_options, #client_secret, #options
Instance Method Summary collapse
- #auth_hash ⇒ Object
-
#initialize(app, client_id = nil, client_secret = nil, options = {}, &block) ⇒ AngelList
constructor
A new instance of AngelList.
- #user_data ⇒ Object
- #user_info ⇒ Object
Methods inherited from OAuth2
Constructor Details
#initialize(app, client_id = nil, client_secret = nil, options = {}, &block) ⇒ AngelList
Returns a new instance of AngelList.
15 16 17 18 19 20 21 22 23 |
# File 'lib/omniauth/strategies/oauth2/angellist.rb', line 15 def initialize(app, client_id=nil, client_secret=nil, ={}, &block) = { :site => 'https://api.angel.co/', :authorize_url => 'https://angel.co/api/oauth/authorize', :token_url => 'https://angel.co/api/oauth/token' } super(app, :angellist, client_id, client_secret, , , &block) end |
Instance Method Details
#auth_hash ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/omniauth/strategies/oauth2/angellist.rb', line 25 def auth_hash OmniAuth::Utils.deep_merge( super, { 'uid' => user_data['id'], 'user_info' => user_info, 'extra' => { 'user_hash' => user_data, } } ) end |
#user_data ⇒ Object
49 50 51 52 53 54 |
# File 'lib/omniauth/strategies/oauth2/angellist.rb', line 49 def user_data @data ||= begin @access_token.[:mode] = :query @access_token.get('/1/me').parsed end end |
#user_info ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/omniauth/strategies/oauth2/angellist.rb', line 37 def user_info { 'name' => user_data['name'], 'bio' => user_data['bio'], 'image' => user_data['image'], 'urls' => { 'AngelList' => user_data['angellist_url'], 'Website' => user_data['online_bio_url'] }, } end |