Skip to content

Commit

Permalink
Authentication fail with user cannot be serialized from session [hear…
Browse files Browse the repository at this point in the history
  • Loading branch information
José Valim committed Nov 10, 2009
1 parent 9a4b374 commit e690168
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rdoc
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/devise/warden.rb
Expand Up @@ -13,7 +13,7 @@
# 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
Expand Down
8 changes: 8 additions & 0 deletions test/integration/authenticatable_test.rb
Expand Up @@ -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

0 comments on commit e690168

Please sign in to comment.