about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-03 16:38:22 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-03 16:51:00 +0200
commitfc198a8b4ca6d22eaedee2cfb03e088432dc4b30 (patch)
treecc57ecb76638deb4b9cafd80e0c14911e4f419c6 /app/controllers
parentb3c7c8700d7ddf73d6fef4076f15ae7c3d39ce67 (diff)
Adding e-mail confirmations
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/controllers/auth/confirmations_controller.rb3
-rw-r--r--app/controllers/auth/sessions_controller.rb8
3 files changed, 11 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 91904ecf0..cd4b686f7 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -10,7 +10,7 @@ class ApplicationController < ActionController::Base
   rescue_from ActionController::RoutingError, with: :not_found
   rescue_from ActiveRecord::RecordNotFound, with: :not_found
 
-  before_filter :store_current_location, :unless => :devise_controller?
+  before_action :store_current_location, :unless => :devise_controller?
 
   def raise_not_found
     raise ActionController::RoutingError, "No route matches #{params[:unmatched_route]}"
diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb
new file mode 100644
index 000000000..b8e9316f1
--- /dev/null
+++ b/app/controllers/auth/confirmations_controller.rb
@@ -0,0 +1,3 @@
+class Auth::ConfirmationsController < Devise::ConfirmationsController
+  layout 'auth'
+end
diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb
index e50a9835c..bd41ffd3d 100644
--- a/app/controllers/auth/sessions_controller.rb
+++ b/app/controllers/auth/sessions_controller.rb
@@ -12,6 +12,12 @@ class Auth::SessionsController < Devise::SessionsController
   protected
 
   def after_sign_in_path_for(_resource)
-    stored_location_for(:user) || root_path
+    last_url = stored_location_for(:user)
+
+    if [about_path].include?(last_url)
+      root_path
+    else
+      last_url || root_path
+    end
   end
 end