oa-cadun 3.1.2 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/oa-cadun/version.rb
CHANGED
@@ -19,31 +19,14 @@ module OmniAuth
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def auth_hash
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
:status => user.status,
|
31
|
-
:nickname => user.login,
|
32
|
-
:name => user.name,
|
33
|
-
:address => user.address,
|
34
|
-
:neighborhood => user.neighborhood,
|
35
|
-
:city => user.city,
|
36
|
-
:state => user.state,
|
37
|
-
:country => user.country,
|
38
|
-
:gender => user.gender,
|
39
|
-
:birthday => user.birthday.strftime('%d/%m/%Y'),
|
40
|
-
:mobile => user.mobile,
|
41
|
-
:phone => user.phone,
|
42
|
-
:cpf => user.cpf,
|
43
|
-
:user_type => user.user_type,
|
44
|
-
:zipcode => user.zipcode
|
45
|
-
}
|
46
|
-
}
|
22
|
+
self.class.build_auth_hash(user, request)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.build_auth_hash(user, request = nil)
|
26
|
+
hash = { :provider => "cadun", :uid => user.id, :user_info => user.to_hash.merge(:birthday => user.birthday.strftime('%d/%m/%Y')) }
|
27
|
+
hash[:user_info].merge!(:GLBID => request.params['GLBID'], :url => request.params['url']) if request
|
28
|
+
|
29
|
+
hash
|
47
30
|
end
|
48
31
|
|
49
32
|
protected
|
@@ -69,11 +69,11 @@ describe OmniAuth::Strategies::Cadun do
|
|
69
69
|
specify { subject[:user_info].should include(:email => "fab1@spam.la") }
|
70
70
|
specify { subject[:user_info].should include(:gender => "MASCULINO") }
|
71
71
|
specify { subject[:user_info].should include(:GLBID => "GLBID") }
|
72
|
-
specify { subject[:user_info].should include(:
|
72
|
+
specify { subject[:user_info].should include(:user_id => "21737810") }
|
73
73
|
specify { subject[:user_info].should include(:mobile => "21 99999999") }
|
74
74
|
specify { subject[:user_info].should include(:name => "Fabricio Rodrigo Lopes") }
|
75
75
|
specify { subject[:user_info].should include(:neighborhood => "Andaraí") }
|
76
|
-
specify { subject[:user_info].should include(:
|
76
|
+
specify { subject[:user_info].should include(:login => "fabricio_fab1") }
|
77
77
|
specify { subject[:user_info].should include(:phone => "21 22881060") }
|
78
78
|
specify { subject[:user_info].should include(:state => "RJ") }
|
79
79
|
specify { subject[:user_info].should include(:status => "ATIVO") }
|