From a7e17a07cc0006140e4234ea8e4e3a3d4f0f0d64 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 4 Sep 2022 17:15:38 +0200 Subject: [PATCH] Fix deleting 2FA and regenerating codes not working --- .../otp_authentication_controller.rb | 2 +- .../otp_authentication/_totp_enabled.haml | 8 ++++---- .../otp_authentication/{index.haml => index.html.haml} | 0 .../{recovery_keys.haml => recovery_keys.html.haml} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename app/views/settings/two_factor_authentication/otp_authentication/{index.haml => index.html.haml} (100%) rename app/views/settings/two_factor_authentication/otp_authentication/{recovery_keys.haml => recovery_keys.html.haml} (100%) diff --git a/app/controllers/settings/two_factor_authentication/otp_authentication_controller.rb b/app/controllers/settings/two_factor_authentication/otp_authentication_controller.rb index c32f6664..ff83ad4d 100644 --- a/app/controllers/settings/two_factor_authentication/otp_authentication_controller.rb +++ b/app/controllers/settings/two_factor_authentication/otp_authentication_controller.rb @@ -36,7 +36,7 @@ class Settings::TwoFactorAuthentication::OtpAuthenticationController < Applicati current_user.save! current_user.totp_recovery_codes.delete_all flash[:success] = t(".success") - redirect_to settings_two_factor_authentication_otp_authentication_path + redirect_to settings_two_factor_authentication_otp_authentication_path, status: :see_other end def reset diff --git a/app/views/settings/two_factor_authentication/otp_authentication/_totp_enabled.haml b/app/views/settings/two_factor_authentication/otp_authentication/_totp_enabled.haml index fcd8fc3b..4dc95b41 100644 --- a/app/views/settings/two_factor_authentication/otp_authentication/_totp_enabled.haml +++ b/app/views/settings/two_factor_authentication/otp_authentication/_totp_enabled.haml @@ -1,6 +1,6 @@ %p= t(".body") %p= t(".recovery_code_count", count: recovery_code_count) -= button_to t(".remove.action"), settings_two_factor_authentication_otp_authentication_path, class: "btn btn-danger", method: "delete", - data: { confirm: t(".remove.confirm") } -= button_to t(".regenerate.action"), settings_two_factor_authentication_otp_authentication_reset_path, class: "btn btn-primary", method: "delete", - data: { confirm: t(".regenerate.confirm") } += link_to t(".remove.action"), settings_two_factor_authentication_otp_authentication_path, class: "btn btn-danger", + data: { turbo_confirm: t(".remove.confirm"), turbo_method: :delete } += link_to t(".regenerate.action"), settings_two_factor_authentication_otp_authentication_reset_path, class: "btn btn-primary", + data: { turbo_confirm: t(".regenerate.confirm"), turbo_method: :delete } diff --git a/app/views/settings/two_factor_authentication/otp_authentication/index.haml b/app/views/settings/two_factor_authentication/otp_authentication/index.html.haml similarity index 100% rename from app/views/settings/two_factor_authentication/otp_authentication/index.haml rename to app/views/settings/two_factor_authentication/otp_authentication/index.html.haml diff --git a/app/views/settings/two_factor_authentication/otp_authentication/recovery_keys.haml b/app/views/settings/two_factor_authentication/otp_authentication/recovery_keys.html.haml similarity index 100% rename from app/views/settings/two_factor_authentication/otp_authentication/recovery_keys.haml rename to app/views/settings/two_factor_authentication/otp_authentication/recovery_keys.html.haml