Disable extraneous devise strategies if DISABLE_DEVISE_TWO_STRATEGIES is set to true (#38486)

This commit is contained in:
Claire authored and GitHub committed 2026-03-30 14:45:59 +00:00
1 parent b1bb3baefb
commit 30275cd80e
1 file changed
+5 -2
+5 -2
View File
@@ -98,8 +98,11 @@ Devise.setup do |config|
manager.default_strategies(scope: :user).unshift :two_factor_ldap_authenticatable if Devise.ldap_authentication
manager.default_strategies(scope: :user).unshift :two_factor_pam_authenticatable if Devise.pam_authentication
manager.default_strategies(scope: :user).unshift :session_activation_rememberable
manager.default_strategies(scope: :user).unshift :two_factor_authenticatable
manager.default_strategies(scope: :user).unshift :two_factor_backupable
unless ENV['DISABLE_DEVISE_TWO_STRATEGIES'] == 'true'
manager.default_strategies(scope: :user).unshift :two_factor_authenticatable
manager.default_strategies(scope: :user).unshift :two_factor_backupable
end
end
# The secret key used by Devise. Devise uses this key to generate