lib/omniauth/strategies/mailchimp.rb in omniauth-mailchimp-1.2.0 vs lib/omniauth/strategies/mailchimp.rb in omniauth-mailchimp-2.0.0
- old
+ new
@@ -18,20 +18,18 @@
options.update(req.params)
super
end
uid {
- raw_info["user_id"]
+ raw_info["account_id"]
}
info do
- contact = raw_info["contact"] || {}
-
{
- :first_name => contact["fname"],
- :last_name => contact["lname"],
- :email => contact["email"]
+ :first_name => raw_info["first_name"],
+ :last_name => raw_info["last_name"],
+ :email => raw_info["email"],
}
end
extra do
{
@@ -43,11 +41,10 @@
def raw_info
@raw_info ||= begin
data = user_data
endpoint = data["api_endpoint"]
- apikey = "#{@access_token.token}-#{data['dc']}"
- response = @access_token.get("#{endpoint}/2.0/helper/account-details?apikey=#{apikey}").parsed
+ response = @access_token.get("#{endpoint}/3.0/").parsed
if response["error"]
case response["code"]
when 109
fail!(:invalid_credentials, response["error"])
end