omniauth-orcid 1.0.30 → 1.0.31

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: fda37b7b6749323749c05caf0e790d162baa5997
4
- data.tar.gz: bf92b03f245608ceeb97f8b245e2ac2648d85846
3
+ metadata.gz: c476ec066f36b268635183f18a9f83001770ee80
4
+ data.tar.gz: 2bdc39d25a23d09c22eef979e75439554581f5d4
5
5
  SHA512:
6
- metadata.gz: b59bd6ca6d78dce871a15fe1ba1125490c98eefd403b30ad0ac3f15978e65809723acfe2ab52212df0f9decbaef60683bfe8df46f9ecbc76870e9eabd3a07c5d
7
- data.tar.gz: 276aca84399811823d5d8406ac92173024cf8d60e1bf81ea1e3245a5bb7e1760880394fdd6f1b3efdefa73e311dadab91ecadd49925d59abf8fc6eb78b7f8b15
6
+ metadata.gz: 293c1fe030cdf8e9d2f12458c7acda47544dd49d4cdee9efba5915a655b9ea79f0227a5a6a2ce1a2089a9ae5ae4065733735b75fa16c3eab31853103f8322761
7
+ data.tar.gz: baeb5ac31997f4a5a82f6407527d2536aaab47636c00e70f154ae29e79281afc9496e08e7cb783a6a8532a12629d8a38baaef5600b901231b875f80eda6e0081
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Orcid
3
- VERSION = "1.0.30"
3
+ VERSION = "1.0.31"
4
4
  end
5
5
  end
@@ -63,6 +63,15 @@ module OmniAuth
63
63
  end
64
64
  end
65
65
 
66
+ def api_base_url
67
+ case namespace
68
+ when 'sandbox' then "https://api.sandbox.orcid.org/v#{API_VERSION}"
69
+ when 'production' then "https://api.orcid.org/v#{API_VERSION}"
70
+ when 'public_sandbox' then "https://pub.sandbox.orcid.org/v#{API_VERSION}"
71
+ when 'public' then "https://pub.orcid.org/v#{API_VERSION}"
72
+ end
73
+ end
74
+
66
75
  def authorize_url
67
76
  if options[:sandbox]
68
77
  'https://sandbox.orcid.org/oauth/authorize'
@@ -105,7 +114,7 @@ module OmniAuth
105
114
  end
106
115
 
107
116
  def request_info
108
- client.request(:get, "https://pub.orcid.org/v#{API_VERSION}/#{uid}/orcid-bio", headers: { accept: 'application/json' }).parsed || {}
117
+ client.request(:get, "#{api_base_url}/#{uid}/orcid-bio", headers: { accept: 'application/json' }).parsed || {}
109
118
  end
110
119
 
111
120
  def raw_info
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.30
4
+ version: 1.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gudmundur A. Thorisson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-06 00:00:00.000000000 Z
12
+ date: 2015-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth-oauth2