omniauth-orcid 1.0.23 → 1.0.24

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: fd796a3f82e00db04780aa43d224e1ddd4740b5b
4
- data.tar.gz: e9ac1dd0719314a73031862d5f63c04a98b8225a
3
+ metadata.gz: d3f06b43ec5fa34b86f5ceacddea71ed0c69888f
4
+ data.tar.gz: 7cd76894dc73db5178e10720e8a4ef14d3d3efd4
5
5
  SHA512:
6
- metadata.gz: efc3639153611feb6858923ec54cf55fc580d24481e517c12f04fc1b2c534a2e7998f51153d465d2be4ab44ee99537727214447eb3edf293c92c51616e5461c4
7
- data.tar.gz: 5914229f8737ed68b6f03f92c54005c391b499937536c6686490cb42d6920d86a6b0993fd3c0d9459abbd22bb41589edb1eee16081c048a60974f168f94f3785
6
+ metadata.gz: 14e3e2f017197901e5fa04deac748ba26ab0ad71b942999ce4f86966a3d8c05dbca6e2a68540c9a2f4710be1658cea50e6c3d8a1fe9fd94458677bb50af60621
7
+ data.tar.gz: 74a2fcdbee3f7c8fa5b604c900cf3a1f8022f3ee0febd0099bf64d9193b0674ef5100e4c5f6ffe44010bcf805a8e762b561a35795c2a203c8737ab52e6ac8e15
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Orcid
3
- VERSION = "1.0.23"
3
+ VERSION = "1.0.24"
4
4
  end
5
5
  end
@@ -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: nil,
98
- last_name: nil,
99
- location: nil,
100
- description: nil,
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
- hsh = {}
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
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.23
4
+ version: 1.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gudmundur A. Thorisson