Class: EmployeeSignedInHandler
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- EmployeeSignedInHandler
- Includes:
- RailsEventStore::AsyncHandler
- Defined in:
- app/subscribers/employee_signed_in_handler.rb
Overview
Triggers a Cloudflare IP list sync when an employee signs in with a new IP.
Subscribes to: Events::EmployeeSignedIn
WHY async: The Cloudflare API call is an external side-effect that must not
block the login flow. Running after_commit via the event store ensures the
account's current_sign_in_ip is fully persisted before the worker reads it.
Instance Method Summary collapse
Instance Method Details
#perform(_event) ⇒ Object
14 15 16 |
# File 'app/subscribers/employee_signed_in_handler.rb', line 14 def perform(_event) CloudflareIpListSyncWorker.perform_async end |