20230523104006_two_factor_authentication_recovery_codes.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class TwoFactorAuthenticationRecoveryCodes < ActiveRecord::Migration[6.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.create_if_not_exists(
  7. title: 'Enable Recovery Codes',
  8. name: 'two_factor_authentication_recovery_codes',
  9. area: 'Security::TwoFactorAuthentication',
  10. description: 'Defines if recovery codes can be used by users in the event they lose access to other two-factor authentication methods.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: true,
  16. name: 'two_factor_authentication_recovery_codes',
  17. tag: 'boolean',
  18. options: {
  19. true => 'yes',
  20. false => 'no',
  21. },
  22. },
  23. ],
  24. },
  25. preferences: {
  26. prio: 5000,
  27. permission: ['admin.security'],
  28. },
  29. state: true,
  30. frontend: true
  31. )
  32. end
  33. end