Authentication fail with user cannot be serialized from session [#29]

This commit is contained in:
José Valim 2009-11-10 00:00:40 -02:00
parent 9a4b374b96
commit e6901686c4
4 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,9 @@
== 0.4.3
* bug fix
* [#29] Authentication fail if user cannot be serialized from session;
* Default configuration values should not overwrite user values;
== 0.4.2
* deprecations

View File

@ -36,7 +36,7 @@ begin
s.description = "Flexible authentication solution for Rails with Warden"
s.authors = ['José Valim', 'Carlos Antônio']
s.files = FileList["[A-Z]*", "{app,config,generators,lib}/**/*", "init.rb"]
s.add_dependency("warden", "~> 0.5.1")
s.add_dependency("warden", "~> 0.5.2")
end
Jeweler::GemcutterTasks.new

View File

@ -13,7 +13,7 @@ Warden::Manager.serialize_into_session{ |user| [user.class, user.id] }
# Session Serialization out. This block gets the user out of the session.
# It should be the reverse of serializing the object into the session
Warden::Manager.serialize_from_session do |klass, id|
klass.find(id)
klass.find_by_id(id)
end
# Setup devise strategies for Warden

View File

@ -184,4 +184,12 @@ class AuthenticationTest < ActionController::IntegrationTest
visit 'users/index'
assert_equal "Cart", @controller.user_session[:cart]
end
test 'destroyed account is logged out' do
sign_in_as_user
visit 'users/index'
User.destroy_all
visit 'users/index'
assert_redirected_to '/users/sign_in?unauthenticated=true'
end
end