warden 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/warden/proxy.rb +2 -0
- data/spec/warden/proxy_spec.rb +26 -0
- data/warden.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/warden/proxy.rb
CHANGED
@@ -139,10 +139,12 @@ module Warden
|
|
139
139
|
def logout(*scopes)
|
140
140
|
if scopes.empty?
|
141
141
|
_session.clear
|
142
|
+
@users.clear
|
142
143
|
else
|
143
144
|
scopes.each do |s|
|
144
145
|
_session["warden.user.#{s}.key"] = nil
|
145
146
|
_session["warden.user.#{s}.session"] = nil
|
147
|
+
@users.delete(s)
|
146
148
|
end
|
147
149
|
end
|
148
150
|
end
|
data/spec/warden/proxy_spec.rb
CHANGED
@@ -237,6 +237,32 @@ describe Warden::Proxy do
|
|
237
237
|
setup_rack(app).call(@env)
|
238
238
|
@env['rack.session'].should be_empty
|
239
239
|
end
|
240
|
+
|
241
|
+
it "should clear the user when logging out" do
|
242
|
+
@env['rack.session'].should_not be_nil
|
243
|
+
app = lambda do |e|
|
244
|
+
e['warden'].user.should_not be_nil
|
245
|
+
e['warden'].logout
|
246
|
+
e['warden'].should_not be_authenticated
|
247
|
+
e['warden'].user.should be_nil
|
248
|
+
valid_response
|
249
|
+
end
|
250
|
+
setup_rack(app).call(@env)
|
251
|
+
@env['warden'].user.should be_nil
|
252
|
+
|
253
|
+
end
|
254
|
+
require 'ruby-debug'
|
255
|
+
it "should clear the session data when logging out" do
|
256
|
+
@env['rack.session'].should_not be_nil
|
257
|
+
app = lambda do |e|
|
258
|
+
# debugger
|
259
|
+
e['warden'].user.should_not be_nil
|
260
|
+
e['warden'].session[:foo] = :bar
|
261
|
+
e['warden'].logout
|
262
|
+
valid_response
|
263
|
+
end
|
264
|
+
setup_rack(app).call(@env)
|
265
|
+
end
|
240
266
|
end
|
241
267
|
|
242
268
|
describe "when all strategies are not valid?" do
|
data/warden.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{warden}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Daniel Neighman"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-08}
|
10
10
|
s.email = %q{has.sox@gmail.com}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Neighman
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-08 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|