Explicitly don't cache sensitive 2FA actions (#43083).

Patch by Felix Schäfer (user:felix).

git-svn-id: https://svn.redmine.org/redmine/trunk@23917 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2025-08-13 05:58:49 +00:00
parent 8f002c297e
commit 2d1f1684a1
4 changed files with 10 additions and 0 deletions

View File

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