From 30c447ed2f35a0d1f4eb0f6200aa9ab952c46768 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 2 Oct 2014 14:38:26 +0200 Subject: Try signing in the user after user confirmation is correct and redirect to dashboard, otherwise redirect to signin page --- app/controllers/confirmations_controller.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/controllers/confirmations_controller.rb (limited to 'app/controllers/confirmations_controller.rb') diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb new file mode 100644 index 00000000000..bc98eab133c --- /dev/null +++ b/app/controllers/confirmations_controller.rb @@ -0,0 +1,17 @@ +class ConfirmationsController < Devise::ConfirmationsController + + protected + + def after_confirmation_path_for(resource_name, resource) + if signed_in?(resource_name) + signed_in_root_path(resource) + else + sign_in(resource) + if signed_in?(resource_name) + signed_in_root_path(resource) + else + new_session_path(resource_name) + end + end + end +end -- cgit v1.2.1