summaryrefslogtreecommitdiff
path: root/app/controllers/confirmations_controller.rb
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-10-02 14:38:26 +0200
committerMarin Jankovski <maxlazio@gmail.com>2014-10-02 14:38:26 +0200
commit30c447ed2f35a0d1f4eb0f6200aa9ab952c46768 (patch)
tree31171a866132c8899cdcf5e58f4fb7c11fddef45 /app/controllers/confirmations_controller.rb
parent9f939c9697c735839072185a9792338f617a2a41 (diff)
downloadgitlab-ce-30c447ed2f35a0d1f4eb0f6200aa9ab952c46768.tar.gz
Try signing in the user after user confirmation is correct and redirect to dashboard, otherwise redirect to signin page
Diffstat (limited to 'app/controllers/confirmations_controller.rb')
-rw-r--r--app/controllers/confirmations_controller.rb17
1 files changed, 17 insertions, 0 deletions
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