lib/sorcery/controller/submodules/external/providers/google.rb in sorcery-0.7.6 vs lib/sorcery/controller/submodules/external/providers/google.rb in sorcery-0.7.7

- old
+ new

@@ -42,20 +42,20 @@ include Protocols::Oauth2 def init @site = "https://accounts.google.com" @auth_url = "/o/oauth2/auth" - @token_path = "/o/oauth2/token" + @token_url = "/o/oauth2/token" @user_info_url = "https://www.googleapis.com/oauth2/v1/userinfo" @scope = "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile" @user_info_mapping = {} end def get_user_hash user_hash = {} response = @access_token.get(@user_info_url) - user_hash[:user_info] = JSON.parse(response) + user_hash[:user_info] = JSON.parse(response.body) user_hash[:uid] = user_hash[:user_info]['id'] user_hash end def has_callback? @@ -71,11 +71,11 @@ # tries to login the user from access token def process_callback(params,session) args = {} args.merge!({:code => params[:code]}) if params[:code] options = { - :access_token_path => @token_path, - :access_token_method => :post + :token_url => @token_url, + :token_method => :post } @access_token = self.get_access_token(args, options) end end init