omniauth-rabobank 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/rabobank.rb +7 -43
- data/lib/omniauth-rabobank/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: 2d8cb48ea90e01fc7cdb25066d7b7ac8cb04dfd0
|
|
4
|
+
data.tar.gz: 2df1653b237dc456d8fbd8abb71163d945b0f236
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fb29799cbfc67f5401fb49e1693c304c1bf1df462a0d92c4b5fb863d885dad34a28dda4b06ee7c07622f09a6a05993ac2c2c3794cb9f6497ebb751916aa9e835
|
|
7
|
+
data.tar.gz: c3273f54626a5184ce90512cc087f37cf963974a5ce61e8f113cbdf9c45522766e6a25ea0060fa5915d81fbcbe5360f7915ac4039217b045405fabe0b9a2dec7
|
|
@@ -23,51 +23,15 @@ module OmniAuth
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
uid
|
|
27
|
-
|
|
28
|
-
info do
|
|
29
|
-
{
|
|
30
|
-
'nickname' => raw_info['login'],
|
|
31
|
-
'email' => email,
|
|
32
|
-
'name' => raw_info['name'],
|
|
33
|
-
'image' => raw_info['avatar_url'],
|
|
34
|
-
'urls' => {
|
|
35
|
-
'GitHub' => raw_info['html_url'],
|
|
36
|
-
'Blog' => raw_info['blog'],
|
|
37
|
-
},
|
|
38
|
-
}
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
extra do
|
|
42
|
-
{:raw_info => raw_info, :all_emails => emails}
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def raw_info
|
|
46
|
-
access_token.options[:mode] = :query
|
|
47
|
-
@raw_info ||= access_token.get('user').parsed
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def email
|
|
51
|
-
(email_access_allowed?) ? primary_email : raw_info['email']
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def primary_email
|
|
55
|
-
primary = emails.find{ |i| i['primary'] && i['verified'] }
|
|
56
|
-
primary && primary['email'] || nil
|
|
26
|
+
uid do
|
|
27
|
+
request.params[options.uid_field.to_s]
|
|
57
28
|
end
|
|
58
29
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def email_access_allowed?
|
|
67
|
-
return false unless options['scope']
|
|
68
|
-
email_scopes = ['user', 'user:email']
|
|
69
|
-
scopes = options['scope'].split(',')
|
|
70
|
-
(scopes & email_scopes).any?
|
|
30
|
+
info do
|
|
31
|
+
options.fields.inject({}) do |hash, field|
|
|
32
|
+
hash[field] = request.params[field.to_s]
|
|
33
|
+
hash
|
|
34
|
+
end
|
|
71
35
|
end
|
|
72
36
|
|
|
73
37
|
def callback_url
|