doorkeeper_hub 0.1.1 → 0.1.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0323f1e027ab3321e8a50037d70ecf9bb7f98f15b0c5d88080870031d20fb71
|
4
|
+
data.tar.gz: d42bd09e2885ac4c4818f3563c8f144bf7dd8c4c1cdefd91c34625d1c8fc4c73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05d6ebb3327da326b0bad77c7d06c0d2d423370f2ea2304777a42122133da11b02e86e631febe19b2aa2666c6f17e7cbe1b04b151454436c9264974deefc8f52
|
7
|
+
data.tar.gz: 933017e512524a9dd518e02e788399e715f63e3a736004de8e8cb7f2014b41c12d6d0adcffc6a6d78978687b0223401fb26ce89d3f2b25dceb01e808502c7068
|
@@ -4,7 +4,7 @@ module DoorkeeperHub
|
|
4
4
|
return if params[:access_token] != DoorkeeperHub.config.service_token
|
5
5
|
# {name, access_token, doorkeeper_token, active, options}
|
6
6
|
record = DoorkeeperHub.config.scope_model.find_or_initialize_by(
|
7
|
-
DoorkeeperHub.
|
7
|
+
DoorkeeperHub.token_name => params[DoorkeeperHub.token_name]
|
8
8
|
)
|
9
9
|
record.update active: params[:active], name: params[:name]
|
10
10
|
render body: nil
|
@@ -1,10 +1,13 @@
|
|
1
1
|
module DoorkeeperHub
|
2
2
|
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
3
|
-
skip_before_action :verify_authenticity_token,
|
3
|
+
skip_before_action :verify_authenticity_token,
|
4
|
+
:check_login!,
|
5
|
+
:check_d_token, only: :saml
|
4
6
|
|
5
7
|
def saml
|
6
|
-
|
7
|
-
|
8
|
+
@user = DoorkeeperHub
|
9
|
+
.user_model
|
10
|
+
.from_omniauth(request.env["omniauth.auth"])
|
8
11
|
|
9
12
|
if @user.present? && @user.persisted?
|
10
13
|
sign_in_and_redirect @user, event: :authentication
|
data/config/routes.rb
ADDED
data/lib/doorkeeper_hub.rb
CHANGED
@@ -11,4 +11,16 @@ module DoorkeeperHub
|
|
11
11
|
def self.configure
|
12
12
|
yield config
|
13
13
|
end
|
14
|
+
|
15
|
+
def self.devise_scope
|
16
|
+
config.user_model.to_s.downcase.pluralize.to_sym
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.user_model
|
20
|
+
config.user_model
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.token_name
|
24
|
+
config.doorkeeper_token_name
|
25
|
+
end
|
14
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper_hub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Fan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- app/controllers/doorkeeper_hub/omniauth_callbacks_controller.rb
|
84
84
|
- bin/console
|
85
85
|
- bin/setup
|
86
|
+
- config/routes.rb
|
86
87
|
- doorkeeper_hub.gemspec
|
87
88
|
- lib/doorkeeper_hub.rb
|
88
89
|
- lib/doorkeeper_hub/configurator.rb
|