monban 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.rdoc +3 -0
- data/lib/monban/configuration.rb +12 -1
- data/lib/monban/version.rb +2 -2
- data/lib/monban/warden_setup.rb +10 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 608af56fdd4c89a460ac08545532bc6a39d47cd6
|
4
|
+
data.tar.gz: 8e41b690802c8cbec996c27937db68b351eaa2a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8245fdd7c1bf279332dec0314ade04e10f2ef9e7ff27d7d194c7d651c4608a5157ef4a26bc1e19dcaf83e3cafc49eb2e93e8631e4a2a394431ad74b25b308184
|
7
|
+
data.tar.gz: e582bf6d7de38f0d25f0f0a0d583439706707685e18bf79433a2157604d16d32756b177d3ef120d5991cf0677b68807aa064387335c65de6103a141fd2399324
|
data/NEWS.rdoc
CHANGED
data/lib/monban/configuration.rb
CHANGED
@@ -11,6 +11,7 @@ module Monban
|
|
11
11
|
attr_accessor :creation_method, :find_method
|
12
12
|
attr_accessor :no_login_handler, :no_login_redirect
|
13
13
|
attr_accessor :authentication_strategy
|
14
|
+
attr_accessor :warden_serialize_into_session, :warden_serialize_from_session
|
14
15
|
|
15
16
|
attr_writer :user_class
|
16
17
|
|
@@ -19,7 +20,7 @@ module Monban
|
|
19
20
|
setup_token_hashing
|
20
21
|
setup_notices
|
21
22
|
setup_services
|
22
|
-
|
23
|
+
setup_warden
|
23
24
|
end
|
24
25
|
|
25
26
|
# Default creation method. Can be overriden via {Monban.configure}
|
@@ -108,9 +109,19 @@ module Monban
|
|
108
109
|
@password_reset_service = Monban::Services::PasswordReset
|
109
110
|
end
|
110
111
|
|
112
|
+
def setup_warden
|
113
|
+
setup_warden_requirements
|
114
|
+
setup_warden_serialization
|
115
|
+
end
|
116
|
+
|
111
117
|
def setup_warden_requirements
|
112
118
|
@failure_app = Monban::FailureApp
|
113
119
|
@authentication_strategy = Monban::Strategies::PasswordStrategy
|
114
120
|
end
|
121
|
+
|
122
|
+
def setup_warden_serialization
|
123
|
+
@warden_serialize_into_session = -> (user) { user.id }
|
124
|
+
@warden_serialize_from_session = -> (id) { Monban.config.user_class.find_by(id: id) }
|
125
|
+
end
|
115
126
|
end
|
116
127
|
end
|
data/lib/monban/version.rb
CHANGED
data/lib/monban/warden_setup.rb
CHANGED
@@ -22,13 +22,8 @@ module Monban
|
|
22
22
|
attr_reader :warden_config
|
23
23
|
|
24
24
|
def setup_warden_manager
|
25
|
-
Warden::Manager.serialize_into_session
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
Warden::Manager.serialize_from_session do |id|
|
30
|
-
Monban.config.user_class.find_by(id: id)
|
31
|
-
end
|
25
|
+
Warden::Manager.serialize_into_session(&serialize_into_session_method)
|
26
|
+
Warden::Manager.serialize_from_session(&serialize_from_session_method)
|
32
27
|
end
|
33
28
|
|
34
29
|
def setup_warden_strategies
|
@@ -40,5 +35,13 @@ module Monban
|
|
40
35
|
config.failure_app = Monban.config.failure_app
|
41
36
|
end
|
42
37
|
end
|
38
|
+
|
39
|
+
def serialize_into_session_method
|
40
|
+
Monban.config.warden_serialize_into_session
|
41
|
+
end
|
42
|
+
|
43
|
+
def serialize_from_session_method
|
44
|
+
Monban.config.warden_serialize_from_session
|
45
|
+
end
|
43
46
|
end
|
44
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monban
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- halogenandtoast
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
256
|
rubyforge_project:
|
257
|
-
rubygems_version: 2.4.5
|
257
|
+
rubygems_version: 2.4.5.1
|
258
258
|
signing_key:
|
259
259
|
specification_version: 4
|
260
260
|
summary: Making rails authentication as simple as possible
|