omniauth-orcid 1.0.23 → 1.0.24
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/orcid/version.rb +1 -1
- data/lib/omniauth/strategies/orcid.rb +14 -10
- 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: d3f06b43ec5fa34b86f5ceacddea71ed0c69888f
|
|
4
|
+
data.tar.gz: 7cd76894dc73db5178e10720e8a4ef14d3d3efd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14e3e2f017197901e5fa04deac748ba26ab0ad71b942999ce4f86966a3d8c05dbca6e2a68540c9a2f4710be1658cea50e6c3d8a1fe9fd94458677bb50af60621
|
|
7
|
+
data.tar.gz: 74a2fcdbee3f7c8fa5b604c900cf3a1f8022f3ee0febd0099bf64d9193b0674ef5100e4c5f6ffe44010bcf805a8e762b561a35795c2a203c8737ab52e6ac8e15
|
|
@@ -94,23 +94,27 @@ module OmniAuth
|
|
|
94
94
|
{ name: access_token.params["name"],
|
|
95
95
|
email: nil,
|
|
96
96
|
nickname: access_token.params["orcid"],
|
|
97
|
-
first_name:
|
|
98
|
-
last_name:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
urls: {}
|
|
97
|
+
first_name: extra.raw_info.first_name,
|
|
98
|
+
last_name: extra.raw_info.last_name,
|
|
99
|
+
description: extra.raw_info.description,
|
|
100
|
+
urls: extra.raw_info.urls
|
|
102
101
|
}
|
|
103
102
|
end
|
|
104
103
|
|
|
105
104
|
extra do
|
|
106
|
-
|
|
107
|
-
hsh[:raw_info] = raw_info unless skip_info?
|
|
108
|
-
hsh
|
|
105
|
+
skip_info? ? {} : { raw_info: raw_info }
|
|
109
106
|
end
|
|
110
107
|
|
|
111
108
|
def raw_info
|
|
112
|
-
info = client.request(:get, "https://pub.orcid.org/v#{API_VERSION}/#{uid}/orcid-bio", headers: { accept: 'application/json' }).parsed
|
|
113
|
-
info['orcid-profile']['orcid-bio']
|
|
109
|
+
info = client.request(:get, "https://pub.orcid.org/v#{API_VERSION}/#{uid}/orcid-bio", headers: { accept: 'application/json' }).parsed || {}
|
|
110
|
+
orcid_bio = info['orcid-profile']['orcid-bio']
|
|
111
|
+
|
|
112
|
+
{ first_name: orcid_bio['given-names']['value'],
|
|
113
|
+
last_name: orcid_bio['family-name']['value'],
|
|
114
|
+
description: orcid_bio['biography']['value'],
|
|
115
|
+
other_names: orcid_bio['other-names'].map { |other_name| other_name['other-name']['value'] },
|
|
116
|
+
urls: {}
|
|
117
|
+
}
|
|
114
118
|
end
|
|
115
119
|
end
|
|
116
120
|
end
|