omniauth-campus 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/campus.rb +13 -35
- data/lib/omniauth-campus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8f3502ca0c026e3ac77aa9a953bff5cf30b1167
|
4
|
+
data.tar.gz: 490ad205651c633aaadbe77db0ac99c7c05afcec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68f6c4d690704b8573ff37d6503b2a3f8d83118cb95929a135c3c05616aa923f1b220b83895c26d1b9f7ca7fa50cf000ccf53eb711ccc54bde95204ec7d80409
|
7
|
+
data.tar.gz: ec5eafef80568b337022a4f77d311a22c7f8f9a6812ec68c9db8d4d4ef0c66c057bb7e26c0bfd48093a6c739953db887a7361ce138e6f54fd331d650762a8f50
|
@@ -18,53 +18,31 @@ module OmniAuth
|
|
18
18
|
option :consumer_key, nil
|
19
19
|
option :consumer_secret, nil
|
20
20
|
|
21
|
-
option :client_options, {:authorize_path => '/oauth/authenticate'
|
22
|
-
|
23
|
-
|
21
|
+
#option :client_options, {:authorize_path => '/oauth/authenticate'
|
22
|
+
#:site => 'http://dev-oauth-test.gotpantheon.com/myawesomejson',
|
23
|
+
#:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil}
|
24
24
|
|
25
|
-
uid { access_token.params[:uid] }
|
26
25
|
|
27
|
-
|
26
|
+
uid{ request.params['user_id'] }
|
27
|
+
|
28
|
+
info do
|
28
29
|
{
|
29
|
-
:email => raw_info['email'],
|
30
30
|
:name => raw_info['name'],
|
31
|
-
|
31
|
+
:location => raw_info['city']
|
32
|
+
}
|
32
33
|
end
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
extra do
|
36
|
+
{
|
37
|
+
'raw_info' => raw_info
|
38
|
+
}
|
37
39
|
end
|
38
40
|
|
39
41
|
def raw_info
|
40
|
-
@raw_info ||= MultiJson.
|
41
|
-
rescue ::Errno::ETIMEDOUT
|
42
|
-
raise ::Timeout::Error
|
42
|
+
@raw_info ||= MultiJson.decode(access_token.get('/me.json')).body
|
43
43
|
end
|
44
44
|
|
45
|
-
alias :old_request_phase :request_phase
|
46
|
-
|
47
|
-
def request_phase
|
48
|
-
%w[force_login lang screen_name].each do |v|
|
49
|
-
if request.params[v]
|
50
|
-
options[:authorize_params][v.to_sym] = request.params[v]
|
51
|
-
end
|
52
|
-
end
|
53
45
|
|
54
|
-
%w[x_auth_access_type].each do |v|
|
55
|
-
if request.params[v]
|
56
|
-
options[:request_params][v.to_sym] = request.params[v]
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
if request.params['use_authorize'] == 'true'
|
61
|
-
options[:client_options][:authorize_path] = '/oauth/authorize'
|
62
|
-
else
|
63
|
-
options[:client_options][:authorize_path] = '/oauth/authenticate'
|
64
|
-
end
|
65
|
-
|
66
|
-
old_request_phase
|
67
|
-
end
|
68
46
|
end
|
69
47
|
end
|
70
48
|
end
|