mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-05 08:33:25 +00:00
Add sudo-mode to all 2fa actions
The sudo-mode window should ensure this does not impede users currently setting up 2fa things, but adds protection when not in 2fa activation/deactivation mode. (#43083). Patch by Felix Schäfer (user:felix). git-svn-id: https://svn.redmine.org/redmine/trunk@23918 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2d1f1684a1
commit
9b807267ac
@ -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')
|
||||
|
||||
@ -27,7 +27,9 @@ class TwofaController < ApplicationController
|
||||
|
||||
before_action :require_active_twofa
|
||||
|
||||
require_sudo_mode :activate_init, :deactivate_init
|
||||
require_sudo_mode :select_scheme,
|
||||
:activate_init, :activate_confirm, :activate,
|
||||
:deactivate_init, :deactivate_confirm, :deactivate
|
||||
|
||||
skip_before_action :check_twofa_activation, only: [:select_scheme, :activate_init, :activate_confirm, :activate]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user