doorkeeper_hub 0.2.5 → 0.2.6

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
- SHA256:
3
- metadata.gz: e01c7be3d1154849752b48682bceab879775dcd774c049db7cdc18373169a37f
4
- data.tar.gz: c951afa7fa61d3dd9d11cb5ad8d72ae52131b2d9d4091bf0bdab541dfdc508e8
2
+ SHA1:
3
+ metadata.gz: 4886a1e7e646155e1ece5c76032fbe062bf349e2
4
+ data.tar.gz: 46dcb35435f9ecd36f26618143b8e86898fa0adf
5
5
  SHA512:
6
- metadata.gz: f3f3ec131caeae19359187cb63cb42f2e0dfab72beaf0d45c6ad80977291f92aacca26add13eae79a683cca8fcb8a5d1017c43752da09f8c0a44717595c770b7
7
- data.tar.gz: 0d93d6c7a57bb170f3aa744bcbfa120366e7cfd1c2816e041373f0a88aa85893e8623b7abfd22cce902fcdd9dfd5062394cfb132a37281152ac9d09306d63bd8
6
+ metadata.gz: cef5140bb3c95bc5839a25a46f905d1e326bd89b96b022ff6f9f8ad79779de8ae60a615ab0bb498153b7581eb433eeda344d7a7b04d8eb036b0f5d0e75e91663
7
+ data.tar.gz: f67e59d3d307c29317aa5296e5444402e57b07b49de20d363a4093b5a041f1a51985d2660e9eb5fdee66e5a40f863f764f4a5e3342dcbf868852892d577fce51
@@ -6,6 +6,7 @@ module DoorkeeperHub
6
6
  def saml
7
7
  @user = DoorkeeperHub
8
8
  .user_model
9
+ .constantize
9
10
  .from_omniauth(request.env["omniauth.auth"])
10
11
 
11
12
  if @user.present? && @user.persisted?
@@ -8,8 +8,8 @@ module DoorkeeperHub
8
8
 
9
9
  def initialize
10
10
  self.service_token = ENV["SERVICE_TOKEN"]
11
- self.user_model = ::User rescue nil
12
- self.scope_model = ::Company rescue nil
11
+ self.user_model = 'User'
12
+ self.scope_model = 'Company'
13
13
  self.doorkeeper_token_name = :doorkeeper_token
14
14
  self.client_mode = false
15
15
  end
@@ -10,7 +10,7 @@ module DoorkeeperHub
10
10
 
11
11
  class_methods do
12
12
  def from_omniauth(auth)
13
- return if DoorkeeperHub.client_mode? && scope_results(auth).empty?
13
+ return if !DoorkeeperHub.client_mode? && scope_results(auth).empty?
14
14
 
15
15
  user = where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
16
16
  user.email = auth.info.email
@@ -28,6 +28,7 @@ module DoorkeeperHub
28
28
  def scope_results(auth)
29
29
  @scope_results ||= DoorkeeperHub
30
30
  .config.scope_model
31
+ .constantize
31
32
  .where(scope_query(auth))
32
33
  end
33
34
 
@@ -1,3 +1,3 @@
1
1
  module DoorkeeperHub
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
@@ -14,11 +14,11 @@ module DoorkeeperHub
14
14
  end
15
15
 
16
16
  def self.devise_routes_scope
17
- user_model.to_s.tableize.to_sym
17
+ user_model.tableize.to_sym
18
18
  end
19
19
 
20
20
  def self.devise_scope
21
- user_model.to_s.underscore.to_sym
21
+ user_model.underscore.to_sym
22
22
  end
23
23
 
24
24
  def self.user_model
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doorkeeper_hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Fan
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.7.3
115
+ rubygems_version: 2.5.2
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: SSO Gem from DevHub.