Merge pull request #6454 from pengfeidong/6453_enable_disable_otp

Ajout d'une variable d'environnement pour désactiver l'OTP des Super-Admin (#6454)
This commit is contained in:
Pierre de La Morinerie 2021-09-09 10:34:14 -05:00 committed by GitHub
commit d5425401f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

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

View file

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

View file

@ -0,0 +1 @@
SUPER_ADMIN_OTP_ENABLED = ENV.fetch("SUPER_ADMIN_OTP_ENABLED", "enabled") == "enabled"