omniauth-orcid 1.0.24 → 1.0.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3f06b43ec5fa34b86f5ceacddea71ed0c69888f
4
- data.tar.gz: 7cd76894dc73db5178e10720e8a4ef14d3d3efd4
3
+ metadata.gz: 2de3f6c44377f7beaffd58677628f0603edf55cf
4
+ data.tar.gz: c224ce105af0051e65180c807ca6ddd6d51c8460
5
5
  SHA512:
6
- metadata.gz: 14e3e2f017197901e5fa04deac748ba26ab0ad71b942999ce4f86966a3d8c05dbca6e2a68540c9a2f4710be1658cea50e6c3d8a1fe9fd94458677bb50af60621
7
- data.tar.gz: 74a2fcdbee3f7c8fa5b604c900cf3a1f8022f3ee0febd0099bf64d9193b0674ef5100e4c5f6ffe44010bcf805a8e762b561a35795c2a203c8737ab52e6ac8e15
6
+ metadata.gz: 19b815350863875dbb0b2ae6aa4e008cb1702bba84aa4d49307e55c0f57720b4dd17ed2cb722edaff6debaba9eb5b987d6b83da02876d8541a4c3c39998401d3
7
+ data.tar.gz: e9f2db1b7963cc0ea75b285a23dcb0eba75de3943f6e3ed6f4866246ce97c99819372b8338ac6c8b1f82d69d0e89f58c4cad71479b861baf79f51cb79e2ede75
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Orcid
3
- VERSION = "1.0.24"
3
+ VERSION = "1.0.25"
4
4
  end
5
5
  end
@@ -107,12 +107,12 @@ module OmniAuth
107
107
 
108
108
  def raw_info
109
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']
110
+ personal_details = info.fetch('orcid-profile', {}).fetch('orcid-bio', {})
111
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'] },
112
+ { first_name: personal_details.fetch('given-names', {}).fetch('value', nil),
113
+ last_name: personal_details.fetch('family-name', {}).fetch('value', nil),
114
+ description: personal_details.fetch('biography', {}).fetch('value', nil),
115
+ other_names: personal_details.fetch('other-names', [{}]).map { |other_name| other_name.fetch('other-name', {}).fetch('value', nil) },
116
116
  urls: {}
117
117
  }
118
118
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-orcid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.24
4
+ version: 1.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gudmundur A. Thorisson