about summary refs log tree commit diff
path: root/app/controllers/settings/two_factor_authentication
diff options
context:
space:
mode:
authorysksn <bluewhale1982@gmail.com>2018-12-13 06:32:13 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-12-12 22:32:13 +0100
commitb048926e678e5b642cb1e939f629236e77944523 (patch)
tree417254cdb17485eb37655b32d3d5ea477e8e8b2a /app/controllers/settings/two_factor_authentication
parent9983d21d35cad6ff1ad809baa7ae79dc430870f5 (diff)
Create Settings::BaseController (#9507)
Define `Settings::BaseController#set_body_classes` so that sub classes
inherit `Settings::BaseController` don't need to define
`#set_body_classes` agein.
Diffstat (limited to 'app/controllers/settings/two_factor_authentication')
-rw-r--r--app/controllers/settings/two_factor_authentication/confirmations_controller.rb7
-rw-r--r--app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb9
2 files changed, 2 insertions, 14 deletions
diff --git a/app/controllers/settings/two_factor_authentication/confirmations_controller.rb b/app/controllers/settings/two_factor_authentication/confirmations_controller.rb
index ee567c2a7..d87117a50 100644
--- a/app/controllers/settings/two_factor_authentication/confirmations_controller.rb
+++ b/app/controllers/settings/two_factor_authentication/confirmations_controller.rb
@@ -2,12 +2,11 @@
 
 module Settings
   module TwoFactorAuthentication
-    class ConfirmationsController < ApplicationController
+    class ConfirmationsController < BaseController
       layout 'admin'
 
       before_action :authenticate_user!
       before_action :ensure_otp_secret
-      before_action :set_body_classes
 
       def new
         prepare_two_factor_form
@@ -44,10 +43,6 @@ module Settings
       def ensure_otp_secret
         redirect_to settings_two_factor_authentication_path unless current_user.otp_secret
       end
-
-      def set_body_classes
-        @body_classes = 'admin'
-      end
     end
   end
 end
diff --git a/app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb b/app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb
index bfb103620..c78166c65 100644
--- a/app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb
+++ b/app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb
@@ -2,11 +2,10 @@
 
 module Settings
   module TwoFactorAuthentication
-    class RecoveryCodesController < ApplicationController
+    class RecoveryCodesController < BaseController
       layout 'admin'
 
       before_action :authenticate_user!
-      before_action :set_body_classes
 
       def create
         @recovery_codes = current_user.generate_otp_backup_codes!
@@ -14,12 +13,6 @@ module Settings
         flash[:notice] = I18n.t('two_factor_authentication.recovery_codes_regenerated')
         render :index
       end
-
-      private
-
-      def set_body_classes
-        @body_classes = 'admin'
-      end
     end
   end
 end