]> cat aescling's git repositories - mastodon.git/commitdiff
Set packs on 2FA-related pages. Fixes #271.
authorDavid Yip <yipdw@member.fsf.org>
Wed, 20 Dec 2017 09:15:54 +0000 (03:15 -0600)
committerDavid Yip <yipdw@member.fsf.org>
Wed, 20 Dec 2017 09:15:54 +0000 (03:15 -0600)
Specifically, this commit:

- changes S::TFA::{Confirmations,RecoveryCodes}Controller to derive from
  S::BaseController, because this gives us the necessary actions and
  packs
- prepends set_pack to Auth::SessionsController's action chain so that
  it takes effect in time for render :two_factor

app/controllers/auth/sessions_controller.rb
app/controllers/settings/two_factor_authentication/confirmations_controller.rb
app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb

index 72d54410223c00b6cd724c0e2e8443b82673940c..f45d77b885c01f22337e738c75a63b458997cbe3 100644 (file)
@@ -8,8 +8,8 @@ class Auth::SessionsController < Devise::SessionsController
   skip_before_action :require_no_authentication, only: [:create]
   skip_before_action :check_suspension, only: [:destroy]
   prepend_before_action :authenticate_with_two_factor, if: :two_factor_enabled?, only: [:create]
+  prepend_before_action :set_pack
   before_action :set_instance_presenter, only: [:new]
-  before_action :set_pack
 
   def create
     super do |resource|
index 4cf62db13ef76a120db22ceaf5482bdfc1657489..f1fa03f0a6bed4e5d97a1514590d697784cf9add 100644 (file)
@@ -2,11 +2,7 @@
 
 module Settings
   module TwoFactorAuthentication
-    class ConfirmationsController < ApplicationController
-      layout 'admin'
-
-      before_action :authenticate_user!
-
+    class ConfirmationsController < BaseController
       def new
         prepare_two_factor_form
       end
index e591e9502d9025d2600d6f93f11e4f7b5ae57a47..94d1567f33e3e862ad8b250f9ccd6a685143919e 100644 (file)
@@ -2,11 +2,7 @@
 
 module Settings
   module TwoFactorAuthentication
-    class RecoveryCodesController < ApplicationController
-      layout 'admin'
-
-      before_action :authenticate_user!
-
+    class RecoveryCodesController < BaseController
       def create
         @recovery_codes = current_user.generate_otp_backup_codes!
         current_user.save!