diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb new file mode 100644 index 00000000..776665be --- /dev/null +++ b/app/controllers/confirmations_controller.rb @@ -0,0 +1,12 @@ +class ConfirmationsController < Devise::ConfirmationsController + protected + + def after_confirmation_path_for(resource_name, resource) + if signed_in? + signed_in_root_path(resource) + else + sign_in resource + root_path + end + end +end diff --git a/config/routes.rb b/config/routes.rb index 6ee73635..f026f5ba 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,7 @@ Osem::Application.routes.draw do else devise_for :users, controllers: { - registrations: :registrations, + registrations: :registrations, confirmations: :confirmations, omniauth_callbacks: 'users/omniauth_callbacks' }, path: 'accounts' end