omniauth-gitee 0.0.3 → 1.0.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d56bad689067c680232ae928a05e410ce57bb01f1eada5bfe720eed8262a1eeb
|
4
|
+
data.tar.gz: 21d8acbf9567dd8bc84c18f3d014f722ef5533e87fcb2d5de6f8e1cc26bb6328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba34fe3b4933fc9ac51c4a0c2b016d55640ad778a79e55864ac2055a39ed5497bc0d95f060758b53ec9274c8958f16c35520844265df20cf2de1c4ef80bbaf60
|
7
|
+
data.tar.gz: 372d421c7e636382f68d81a1e08698e778c054fc0bbf77525100a80e309afe6471142e15205ca61beca0e8ed85b4eb2d4ac8b4fc2e2474deb9e30bf00b6d4099
|
@@ -57,7 +57,7 @@ module OmniAuth
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def primary_email
|
60
|
-
primary = emails.find{ |i| i['scope'].include? 'primary' && i['state'] == 'confirmed' }
|
60
|
+
primary = emails.find{ |i| (i['scope'].include? 'primary') && i['state'] == 'confirmed' }
|
61
61
|
primary && primary['email'] || nil
|
62
62
|
end
|
63
63
|
|
@@ -71,7 +71,7 @@ module OmniAuth
|
|
71
71
|
def email_access_allowed?
|
72
72
|
return false unless options['scope']
|
73
73
|
email_scopes = %w[user_info emails]
|
74
|
-
scopes = options['scope'].split('
|
74
|
+
scopes = options['scope'].split(' ')
|
75
75
|
(scopes & email_scopes).any?
|
76
76
|
end
|
77
77
|
|
@@ -39,7 +39,7 @@ describe OmniAuth::Strategies::Gitee do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'should allow email if scope is a bunch of stuff including user_info' do
|
42
|
-
subject.options['scope'] = 'public_repo
|
42
|
+
subject.options['scope'] = 'public_repo user_info repo delete_repo gist'
|
43
43
|
expect(subject).to be_email_access_allowed
|
44
44
|
end
|
45
45
|
|