lib/omniauth/strategies/dailycred.rb in dailycred-0.1.30 vs lib/omniauth/strategies/dailycred.rb in dailycred-0.1.31

- old
+ new

@@ -10,11 +10,11 @@ class Dailycred < OmniAuth::Strategies::OAuth2 # default options option :client_options, { :site => "https://www.dailycred.com", - :authorize_url => '/connect', + :authorize_url => '/oauth/authorize', :token_url => '/oauth/access_token' } # parameters to expect and return from dailycred responses ATTRIBUTES = ["email", "username", "created", "verified", "admin", "referred_by", "tags", "referred"] @@ -39,10 +39,11 @@ end end # this step allows auth_params to be added to the url def request_phase + p session['omniauth.state'] OmniAuth::Strategies::Dailycred::AUTH_PARAMS.each do |param| val = session['omniauth.params'][param] if val && !val.empty? options[:authorize_params] ||= {} options[:authorize_params].merge!(param => val) @@ -64,13 +65,13 @@ @duser['provider'] = 'dailycred' @duser['uid'] = json['id'] || json['user_id'] OmniAuth::Strategies::Dailycred::ATTRIBUTES.each do |attr| @duser[attr] = json[attr] end - if !json["FACEBOOK"].nil? - @duser['facebook'] = json["FACEBOOK"]["members"] - @duser['facebook']['access_token'] = json["FACEBOOK"]['access_token'] - end + json["identities"].each do |k, v| + @duser[k] = v + @duser[k][:access_token] = json["access_tokens"][k] + end if !json["identities"].nil? # pp @duser @duser end \ No newline at end of file