Do not call after sign in hook without resource, closes #1666.

This commit is contained in:
José Valim 2012-03-03 12:09:26 +01:00
parent b93288875f
commit 2f6ecc1328
2 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
devise (2.0.2)
devise (2.0.4)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
railties (~> 3.1)

View File

@ -89,8 +89,7 @@ MESSAGE
warden.authenticated?(resource_name)
end
if authenticated
resource = warden.user(resource_name)
if authenticated && resource = warden.user(resource_name)
flash[:alert] = I18n.t("devise.failure.already_authenticated")
redirect_to after_sign_in_path_for(resource)
end