Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from brendte/master

Adds uid to the response hash, as well as the full raw_data hash to extra.
  • Loading branch information...
commit d248e626de8881322be9c2fa535b730d02c645cd 2 parents d38bbf0 + e81734a
@arunagw authored
Showing with 14 additions and 8 deletions.
  1. +14 −8 lib/omniauth/strategies/foursquare.rb
View
22 lib/omniauth/strategies/foursquare.rb
@@ -8,6 +8,19 @@ class Foursquare < OmniAuth::Strategies::OAuth2
:authorize_url => '/oauth2/authorize',
:token_url => '/oauth2/access_token'
}
+
+ uid { raw_info['id'] }
+
+ info do
+ {
+ :first_name => raw_info['firstName'],
+ :last_name => raw_info['lastName']
+ }
+ end
+
+ extra do
+ { :raw_info => raw_info }
+ end
def request_phase
options[:authorize_params] = client_params.merge(options[:authorize_params])
@@ -18,14 +31,7 @@ def auth_hash
OmniAuth::Utils.deep_merge(super, client_params.merge({
:grant_type => 'authorization_code'}))
end
-
- info do
- {
- :first_name => raw_info['firstName'],
- :last_name => raw_info['lastName']
- }
- end
-
+
def raw_info
access_token.options[:mode] = :query
access_token.options[:param_name] = :oauth_token
Please sign in to comment.
Something went wrong with that request. Please try again.