Show 2fa tab in Admin/users only when it is enabled (#5)

[ci skip]
pull/6827/head
Henriette Dinger 7 years ago committed by Oliver Günther
parent 3f6e2abaf5
commit 079d95b9eb
  1. 6
      lib/open_project/two_factor_authentication/patches/users_helper_patch.rb

@ -13,7 +13,11 @@ module OpenProject::TwoFactorAuthentication::Patches
# Adds a 2FA tab to the user administration page
def user_settings_tabs_with_2fa
# Core defined data
user_settings_tabs_without_2fa + [{ name: 'two_factor_authentication', partial: 'users/two_factor_authentication', label: 'two_factor_authentication.label_two_factor_authentication' }]
if OpenProject::TwoFactorAuthentication::TokenStrategyManager.enabled?
user_settings_tabs_without_2fa + [{ name: 'two_factor_authentication', partial: 'users/two_factor_authentication', label: 'two_factor_authentication.label_two_factor_authentication' }]
else
user_settings_tabs_without_2fa
end
end
end
end

Loading…
Cancel
Save