Skip to content

Commit

Permalink
Do not call after sign in hook without resource, closes #1666.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Mar 3, 2012
1 parent b932888 commit 2f6ecc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/devise_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ def require_no_authentication
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
Expand Down

0 comments on commit 2f6ecc1

Please sign in to comment.