diff --git a/app/controllers/manager/application_controller.rb b/app/controllers/manager/application_controller.rb index fb3ad20ea..badd07636 100644 --- a/app/controllers/manager/application_controller.rb +++ b/app/controllers/manager/application_controller.rb @@ -16,7 +16,7 @@ module Manager if super_admin_signed_in? && current_super_admin.otp_required_for_login? super elsif super_admin_signed_in? - redirect_to edit_super_admin_otp_path + SUPER_ADMIN_OTP_ENABLED ? (redirect_to edit_super_admin_otp_path) : super else redirect_to new_super_admin_session_path end diff --git a/config/env.example.optional b/config/env.example.optional index 1553eb594..5302e7641 100644 --- a/config/env.example.optional +++ b/config/env.example.optional @@ -72,3 +72,6 @@ DS_ENV="staging" # Active la localisation # LOCALIZATION_ENABLED="true" + +# Désactivé l'OTP pour SuperAdmin +# SUPER_ADMIN_OTP_ENABLED = "disabled" # "enabled" par défaut diff --git a/config/initializers/otp.rb b/config/initializers/otp.rb new file mode 100644 index 000000000..67dcf61df --- /dev/null +++ b/config/initializers/otp.rb @@ -0,0 +1 @@ +SUPER_ADMIN_OTP_ENABLED = ENV.fetch("SUPER_ADMIN_OTP_ENABLED", "enabled") == "enabled"