lib/sorcery/controller/submodules/external/providers/github.rb in sorcery-0.8.1 vs lib/sorcery/controller/submodules/external/providers/github.rb in sorcery-0.8.2

- old
+ new

@@ -25,10 +25,11 @@ update! end end module GithubClient + include Base::BaseClient class << self attr_accessor :key, :secret, :callback_url, :auth_path, @@ -48,13 +49,13 @@ @auth_path = "/login/oauth/authorize" @token_path = "/login/oauth/access_token" @user_info_mapping = {} end - def get_user_hash + def get_user_hash(access_token) user_hash = {} - response = @access_token.get(@user_info_path) + response = access_token.get(@user_info_path) user_hash[:user_info] = JSON.parse(response.body) user_hash[:uid] = user_hash[:user_info]['id'] user_hash end @@ -74,10 +75,10 @@ args.merge!({:code => params[:code]}) if params[:code] options = { :token_url => @token_path, :token_method => :post } - @access_token = self.get_access_token(args, options) + return self.get_access_token(args, options) end end init end