Class: Users::SupportPin::RevokeService

Inherits:
BaseService show all
Defined in:
app/services/users/support_pin/revoke_service.rb

Constant Summary

Constants inherited from BaseService

BaseService::SUPPORT_PIN_EXPIRATION, BaseService::SUPPORT_PIN_PREFIX

Instance Method Summary collapse

Methods inherited from BaseService

#initialize, #pin_exists?, #pin_key

Constructor Details

This class inherits a constructor from Users::SupportPin::BaseService

Instance Method Details

#executeObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/services/users/support_pin/revoke_service.rb', line 6

def execute
  return { status: :not_found, message: 'Support PIN not found or already expired' } unless pin_exists?

  revoked = revoke_pin

  if revoked
    { status: :success }
  else
    { status: :error, message: 'Failed to revoke support PIN' }
  end
end