summaryrefslogtreecommitdiffstats
path: root/app/controllers/twofa_backup_codes_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/twofa_backup_codes_controller.rb')
-rw-r--r--app/controllers/twofa_backup_codes_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/twofa_backup_codes_controller.rb b/app/controllers/twofa_backup_codes_controller.rb
index 8e14247b0..923b9671b 100644
--- a/app/controllers/twofa_backup_codes_controller.rb
+++ b/app/controllers/twofa_backup_codes_controller.rb
@@ -26,7 +26,7 @@ class TwofaBackupCodesController < ApplicationController
before_action :twofa_setup
- require_sudo_mode :init
+ require_sudo_mode :init, :confirm, :create, :show
def init
if @twofa.send_code(controller: 'twofa_backup_codes', action: 'create')
@@ -37,6 +37,7 @@ class TwofaBackupCodesController < ApplicationController
def confirm
@twofa_view = @twofa.otp_confirm_view_variables
+ no_store
end
def create
@@ -64,6 +65,7 @@ class TwofaBackupCodesController < ApplicationController
if tokens.present? && (@created_at = tokens.collect(&:created_on).max) > 5.minutes.ago
@backup_codes = tokens.collect(&:value)
+ no_store
else
flash[:warning] = l('twofa_backup_codes_already_shown', bc_path: my_twofa_backup_codes_init_path)
redirect_to controller: 'my', action: 'account'