Class: TwoFactor::DestroyService
- Inherits:
-
BaseService
- Object
- BaseService
- TwoFactor::DestroyService
- Defined in:
- app/services/two_factor/destroy_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
Instance Method Summary collapse
Methods inherited from BaseService
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
This class inherits a constructor from TwoFactor::BaseService
Instance Method Details
#execute ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/services/two_factor/destroy_service.rb', line 5 def execute return error(_('You are not authorized to perform this action')) unless return error(_('Two-factor authentication is not enabled for this user')) unless user.two_factor_enabled? result = disable_two_factor notify_on_success(user) if result[:status] == :success result end |