omniauth-orcid 1.0.2 → 1.0.3

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: 3433775b793b7860d91b4f8e809575e1610b64ae
4
- data.tar.gz: e8c54ca4b1ebadb64710036159bb1dccaf1a6d00
3
+ metadata.gz: 55c817897ccb1d8dcc81ae43fc827354a4c65051
4
+ data.tar.gz: 1040b4f7267fdb987c5ff526fdf9bb826bea6e68
5
5
  SHA512:
6
- metadata.gz: 7a34431d0520bb7b8a7e51b26034a2eb3fc775f951ce83047c91819a075a33a7ab725f5370d0141a17d5da1f5e1f37f49e60bfefb71de2ef245352ab951be839
7
- data.tar.gz: 5c0f534a4f938b699fe1164159770e53d340396d86e50342f6873d202784bb4d5179df4e4cc5f264097b2d0391101ed309b15db4ad6440212d9654bfe977eeb0
6
+ metadata.gz: e4f8e8096f92f0a003579a2aad107b1a4d56d4bdd54ecada707122b95cdb303ea984481efd0face12e3ec2de4590f270cc5729051fb79076950844f5268af058
7
+ data.tar.gz: 4cf6d8246b7f98897783e361a843a22eb203ff558a108d7ce2b416a6a67f7d336316606025c9c9c1fd391fba08e332b6f8fde8687f3862a419c69432e0e149e3
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Orcid
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
@@ -6,6 +6,9 @@ module OmniAuth
6
6
  module Strategies
7
7
  class ORCID < OmniAuth::Strategies::OAuth2
8
8
 
9
+ DEFAULT_SCOPE = '/authenticate'
10
+ DEFAULT_SHOW_LOGIN = 'true'
11
+
9
12
  option :name, "orcid"
10
13
 
11
14
  option :client_options, {
@@ -14,9 +17,14 @@ module OmniAuth
14
17
  scope: '/authenticate'
15
18
  }
16
19
 
17
- def request_phase
18
- options[:show_login] ||= "false"
19
- super
20
+ def authorize_params
21
+
22
+ # Trick shamelessly borrowed from the omniauth-facebook gem!
23
+ super.tap do |params|
24
+ %w(scope show_login).each { |v| params[v.to_sym] = request.params[v] if request.params[v] }
25
+ params[:scope] ||= DEFAULT_SCOPE # ensure that we're always request *some* default scope
26
+ params[:show_login] ||= DEFAULT_SHOW_LOGIN # bypass registration screen
27
+ end
20
28
  end
21
29
 
22
30
  uid { raw_info["orcid"] }
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.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gudmundur A. Thorisson