devise_auth_proxy 0.1.17 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -1
- data/lib/devise_auth_proxy/helper.rb +11 -0
- data/lib/devise_auth_proxy/manager.rb +2 -0
- data/lib/devise_auth_proxy/strategy.rb +3 -0
- data/lib/devise_auth_proxy/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f48da9026374575851d42fa970741c996e24d095039cd46a044130fda595b9c2
|
4
|
+
data.tar.gz: a753b83b27ca69ca517524521d1af05cffb3807a6b5e31168a0b26b35da71dba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 714c1ea62a39dab0087f874ce637cb1576c4b142a132e59f17aeed0a870d299f720041573da16f3197d7428ad8cf81dddb4979ea42dc903ba99c35b6fb3df1c4
|
7
|
+
data.tar.gz: 4f3bf097a00d7610e902a789a80f03adce1fe790ca71947adeb5f5273e042afe2ca9ee97b25b316757e672e8136fcb8cb08fec976eae68bfd33bd661c95b8140
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -24,12 +24,14 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
Invoke hook
|
26
26
|
* Add `:auth_proxy_authenticatable` symbol to `devise` statement in User model, before other authentication strategies (e.g., `:database_authenticatable`).
|
27
|
+
* Add `include DeviseAuthProxy::Helper` to ApplicationController to override `after_sign_out_path_for` of devise if you want to modify the redirect url after sign out.
|
27
28
|
|
28
|
-
|
29
|
+
Configuration options:
|
29
30
|
* `env_key` - String (default: 'AUTH_PROXY'). Request environment key for the proxy user id.
|
30
31
|
* `attribute_map` - Hash (default: {}). Map of User model attributes to request environment keys for updating the local user when auto-creation is enabled.
|
31
32
|
* `auto_create` - Boolean (default: false). Whether to auto-create a local user from the proxy user attributes. Note: Also requires adding the Warden callbacks as shown below.
|
32
33
|
* `auto_update` - Boolean (default: false). Whether to auto-update authenticated user attributes from proxy user attributes.
|
34
|
+
* `default_role` - List (default: []). A list of role default for new user. If your application integrate with CanCan of something like that.
|
33
35
|
* `logout_url` - String (default: '/'). For redirecting to a proxy user logout URL after signing out of the Rails application. Include DeviseAuthProxy::ControllerBehavior in your application controller to enable (by overriding Devise's after_sign_out_path_for).
|
34
36
|
|
35
37
|
|
@@ -43,6 +45,7 @@ DeviseAuthProxy.configure do |config|
|
|
43
45
|
config.auto_create = true
|
44
46
|
config.auto_update = true
|
45
47
|
config.attribute_map = { email: 'mail' }
|
48
|
+
config.default_role = ['role_name / role_id']
|
46
49
|
config.logout_url = "http://localhost:3000/logout"
|
47
50
|
end
|
48
51
|
```
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module DeviseAuthProxy
|
2
|
+
module Helper
|
3
|
+
|
4
|
+
# Modify session controller after user log out.
|
5
|
+
# To redirect user to a custom url.
|
6
|
+
def after_sign_out_path_for(resource_or_scope)
|
7
|
+
return DeviseAuthProxy.logout_url if DeviseAuthProxy.logout_url
|
8
|
+
super
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_auth_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QuangTK
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- bin/setup
|
45
45
|
- devise_auth_proxy.gemspec
|
46
46
|
- lib/devise_auth_proxy.rb
|
47
|
+
- lib/devise_auth_proxy/helper.rb
|
47
48
|
- lib/devise_auth_proxy/manager.rb
|
48
49
|
- lib/devise_auth_proxy/model.rb
|
49
50
|
- lib/devise_auth_proxy/strategy.rb
|