From d6151cfd56e01282190d95fce559aa5417a18248 Mon Sep 17 00:00:00 2001 From: Nicolas Temciuc Date: Thu, 14 Aug 2025 13:49:04 -0300 Subject: [PATCH] feat: redirect to two factor methods index after disabling 2FA Co-authored-by: Santiago Rodriguez --- .../two_factor_authentication_methods_controller.rb | 2 +- .../two_factor_authentication_methods/index.html.haml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/settings/two_factor_authentication_methods_controller.rb b/app/controllers/settings/two_factor_authentication_methods_controller.rb index 97b72f68028..6162de2a671 100644 --- a/app/controllers/settings/two_factor_authentication_methods_controller.rb +++ b/app/controllers/settings/two_factor_authentication_methods_controller.rb @@ -16,7 +16,7 @@ module Settings current_user.disable_two_factor! UserMailer.two_factor_disabled(current_user).deliver_later! - redirect_to settings_otp_authentication_path, flash: { notice: I18n.t('two_factor_authentication.disabled_success') } + redirect_to settings_two_factor_authentication_methods_path, flash: { notice: I18n.t('two_factor_authentication.disabled_success') } end private diff --git a/app/views/settings/two_factor_authentication_methods/index.html.haml b/app/views/settings/two_factor_authentication_methods/index.html.haml index 017ad350cbd..cf2113132f6 100644 --- a/app/views/settings/two_factor_authentication_methods/index.html.haml +++ b/app/views/settings/two_factor_authentication_methods/index.html.haml @@ -1,10 +1,10 @@ - content_for :page_title do = t('settings.two_factor_authentication') -- content_for :heading_actions do - = link_to t('two_factor_authentication.disable'), disable_settings_two_factor_authentication_methods_path, class: 'button button--destructive', method: :post - - if current_user.two_factor_enabled? + - content_for :heading_actions do + = link_to t('two_factor_authentication.disable'), disable_settings_two_factor_authentication_methods_path, class: 'button button--destructive', method: :post + %p.hint %span.positive-hint = material_symbol 'check'