lib/omniauth/strategies/dailycred.rb in dailycred-0.1.35 vs lib/omniauth/strategies/dailycred.rb in dailycred-0.1.36
- old
+ new
@@ -14,13 +14,10 @@
:site => "https://www.dailycred.com",
: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"]
-
# allows parameters to be passed through
AUTH_PARAMS = ["action","identity_provider","referrer"]
option :authorize_options, OmniAuth::Strategies::Dailycred::AUTH_PARAMS
@@ -62,11 +59,11 @@
json = JSON.parse(response.body)
# pp json
@duser = {'token' => access_token.token}
@duser['provider'] = 'dailycred'
@duser['uid'] = json['id'] || json['user_id']
- OmniAuth::Strategies::Dailycred::ATTRIBUTES.each do |attr|
- @duser[attr] = json[attr]
+ json.each do |k,v|
+ @duser[k] = v
end
json["identities"].each do |k, v|
@duser[k] = v
@duser[k][:access_token] = json["access_tokens"][k]
end if !json["identities"].nil?
\ No newline at end of file