about summary refs log tree commit diff
path: root/app/controllers/auth
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-06 17:19:26 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-06 17:19:26 +0100
commit1357c1cb3d6b5c46c96dfd2ee25a2a60bccc5092 (patch)
tree5c7f79bdbb6e03dd2eb5c6a9d51756d8955137e6 /app/controllers/auth
parent84d2371d6a4eb928f47d436b92bc9ad292b7d452 (diff)
Add single user mode
Diffstat (limited to 'app/controllers/auth')
-rw-r--r--app/controllers/auth/registrations_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb
index f06a1dce1..60eb9905a 100644
--- a/app/controllers/auth/registrations_controller.rb
+++ b/app/controllers/auth/registrations_controller.rb
@@ -3,6 +3,7 @@
 class Auth::RegistrationsController < Devise::RegistrationsController
   layout 'auth'
 
+  before_action :check_single_user_mode
   before_action :configure_sign_up_params, only: [:create]
 
   protected
@@ -21,4 +22,8 @@ class Auth::RegistrationsController < Devise::RegistrationsController
   def after_sign_up_path_for(_resource)
     new_user_session_path
   end
+
+  def check_single_user_mode
+    redirect_to root_path if Rails.configuration.x.single_user_mode
+  end
 end