diff --git a/Gemfile.lock b/Gemfile.lock index 2901b9b0..a20e0ea5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) diff --git a/app/controllers/devise_controller.rb b/app/controllers/devise_controller.rb index a1ea8000..c3697938 100644 --- a/app/controllers/devise_controller.rb +++ b/app/controllers/devise_controller.rb @@ -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