rack-cerberus 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -0
- data/cerberus.gemspec +1 -1
- data/cerberus.rb +7 -1
- data/spec.rb +6 -0
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -58,6 +58,7 @@ If you want to help me, don't hesitate to fork that project on Github or send pa
|
|
58
58
|
0.1.0 Make it possible to authenticate through GET request (for restful APIs)
|
59
59
|
0.1.1 Documentation improvement
|
60
60
|
0.1.2 Raise message when using without session
|
61
|
+
0.1.3 Don't go to page /logout when signing in after a logout (redirect to / instead)
|
61
62
|
|
62
63
|
=== Copyright
|
63
64
|
|
data/cerberus.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'rack-cerberus'
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.3"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.summary = "A Rack middleware for form-based authentication"
|
6
6
|
s.description = "A Rack middleware for form-based authentication. Aim is a compromise between fonctionality, beauty and customization."
|
data/cerberus.rb
CHANGED
@@ -73,7 +73,13 @@ PAGE
|
|
73
73
|
err = req.post? ? "<p class='err'>Wrong login or password</p>" : ''
|
74
74
|
if ((env['rack.session']['cerberus_user']!=nil && env['PATH_INFO']!='/logout') || (login && pass && @block.call(login, pass)))
|
75
75
|
env['rack.session']['cerberus_user'] ||= login
|
76
|
-
|
76
|
+
if env['PATH_INFO']=='/logout'
|
77
|
+
res = Rack::Response.new(env)
|
78
|
+
res.redirect('/')
|
79
|
+
res.finish
|
80
|
+
else
|
81
|
+
@app.call(env)
|
82
|
+
end
|
77
83
|
else
|
78
84
|
env['rack.session'].delete('cerberus_user')
|
79
85
|
icon = @options[:icon_url].nil? ? '' : "<img src='#{@options[:icon_url]}' /><br />"
|
data/spec.rb
CHANGED
@@ -48,4 +48,10 @@ describe 'cerberus' do
|
|
48
48
|
res.status.should==401
|
49
49
|
end
|
50
50
|
|
51
|
+
should 'Not send not_found when logging after a logout (because the path is /logout)' do
|
52
|
+
res = req.get('/logout', :params => {'cerberus_login' => 'mario', 'cerberus_pass' => 'bros'})
|
53
|
+
res.status.should==302
|
54
|
+
res['Location'].should=='/'
|
55
|
+
end
|
56
|
+
|
51
57
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-cerberus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mickael Riga
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-07-07 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|