Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #4 from lucasallan/master

Getting parameters from Rack request and send it to mailchimp
  • Loading branch information...
commit f0437b0f29915179d281ca7f939b121353899f8b 2 parents 338b582 + 098fe2f
florian mhun authored December 02, 2012

Showing 1 changed file with 13 additions and 7 deletions. Show diff stats Hide diff stats

  1. 20  lib/omniauth/strategies/mailchimp.rb
20  lib/omniauth/strategies/mailchimp.rb
@@ -4,29 +4,35 @@
4 4
 module OmniAuth
5 5
   module Strategies
6 6
     class Mailchimp < OmniAuth::Strategies::OAuth2
7  
-      
  7
+
8 8
       option :name, "mailchimp"
9  
-      
  9
+
10 10
       option :client_options, {
11 11
         :site => "https://login.mailchimp.com",
12 12
         :authorize_url => '/oauth2/authorize',
13 13
         :token_url => '/oauth2/token'
14 14
       }
15 15
 
  16
+      def request_phase
  17
+        req = Rack::Request.new(@env)
  18
+        options.update(req.params)
  19
+        super
  20
+      end
  21
+
16 22
       uid {
17 23
         raw_info["user_id"]
18 24
       }
19 25
 
20 26
       info do
21  
-        { 
  27
+        {
22 28
           :first_name => raw_info["contact"]["fname"],
23 29
           :last_name => raw_info["contact"]["lname"],
24  
-          :email => raw_info["contact"]["email"] 
  30
+          :email => raw_info["contact"]["email"]
25 31
         }
26 32
       end
27  
-      
28  
-      extra do 
29  
-        { 
  33
+
  34
+      extra do
  35
+        {
30 36
           :metadata => user_data,
31 37
           :raw_info => raw_info
32 38
         }

0 notes on commit f0437b0

Please sign in to comment.
Something went wrong with that request. Please try again.