Remove user tab patch (#7)

[ci skip]
pull/6827/head
Oliver Günther 7 years ago committed by GitHub
parent 3c4229b1c7
commit 38d35c806a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      lib/open_project/two_factor_authentication/engine.rb
  2. 19
      lib/open_project/two_factor_authentication/patches/users_helper_patch.rb

@ -36,7 +36,13 @@ module OpenProject::TwoFactorAuthentication
)
end
patches %i[User UsersHelper]
patches %i[User]
add_tab_entry :user,
name: 'two_factor_authentication',
partial: 'users/two_factor_authentication',
label: 'two_factor_authentication.label_two_factor_authentication',
only_if: ->(*) { OpenProject::TwoFactorAuthentication::TokenStrategyManager.enabled? }
config.to_prepare do
# Verify the validity of the configuration

@ -1,19 +0,0 @@
module OpenProject::TwoFactorAuthentication::Patches
module UsersHelperPatch
def self.included(base) # :nodoc:
base.prepend(InstanceMethods)
end
module InstanceMethods
# Adds a 2FA tab to the user administration page
def user_settings_tabs
# Core defined data
if OpenProject::TwoFactorAuthentication::TokenStrategyManager.enabled?
super + [{ name: 'two_factor_authentication', partial: 'users/two_factor_authentication', label: 'two_factor_authentication.label_two_factor_authentication' }]
else
super
end
end
end
end
end
Loading…
Cancel
Save