Add single user mode

This commit is contained in:
Eugen Rochko committed 2016-12-06 17:19:26 +01:00
1 parent 84d2371d6a
commit 1357c1cb3d
4 files changed
+25 -8

No files matched your search

@@ -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