rack-cerberus 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.rdoc +1 -1
  2. data/cerberus.gemspec +1 -1
  3. data/cerberus.rb +1 -1
  4. data/spec.rb +5 -0
  5. metadata +4 -4
data/README.rdoc CHANGED
@@ -58,7 +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
+ 0.1.3-4 Don't go to page /logout when signing in after a logout (redirect to / instead)
62
62
 
63
63
  === Copyright
64
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"
3
+ s.version = "0.1.4"
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
@@ -75,7 +75,7 @@ PAGE
75
75
  env['rack.session']['cerberus_user'] ||= login
76
76
  if env['PATH_INFO']=='/logout'
77
77
  res = Rack::Response.new(env)
78
- res.redirect('/')
78
+ res.redirect(env['SCRIPT_NAME']=='' ? '/' : env['SCRIPT_NAME'])
79
79
  res.finish
80
80
  else
81
81
  @app.call(env)
data/spec.rb CHANGED
@@ -52,6 +52,11 @@ describe 'cerberus' do
52
52
  res = req.get('/logout', :params => {'cerberus_login' => 'mario', 'cerberus_pass' => 'bros'})
53
53
  res.status.should==302
54
54
  res['Location'].should=='/'
55
+
56
+ req = Rack::MockRequest.new(Rack::URLMap.new({'/backend' => app}))
57
+ res = req.get('/backend/logout', :params => {'cerberus_login' => 'mario', 'cerberus_pass' => 'bros'})
58
+ res.status.should==302
59
+ res['Location'].should=='/backend'
55
60
  end
56
61
 
57
62
  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: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
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-07-07 00:00:00 +01:00
18
+ date: 2010-07-12 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21