lib/omniauth/strategies/facebook.rb in oa-oauth-0.0.1 vs lib/omniauth/strategies/facebook.rb in oa-oauth-0.0.4
- old
+ new
@@ -1,6 +1,7 @@
-require 'json'
+require 'omniauth/oauth'
+require 'multi_json'
module OmniAuth
module Strategies
#
# Authenticate to Facebook utilizing OAuth 2.0 and retrieve
@@ -18,11 +19,11 @@
options[:site] = 'https://graph.facebook.com/'
super(app, :facebook, app_id, app_secret, options)
end
def user_data
- @data ||= JSON.parse(@access_token.get('/me'))
+ @data ||= MultiJson.decode(@access_token.get('/me'))
end
def request_phase(options = {})
options[:scope] ||= "email,offline_access"
super(options)
@@ -48,6 +49,6 @@
'extra' => {'user_hash' => user_data}
})
end
end
end
-end
\ No newline at end of file
+end