Class: EventSubEvents::WebhookController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/event_sub_events/webhook_controller.rb

Instance Method Summary collapse

Instance Method Details

#eventObject



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/event_sub_events/webhook_controller.rb', line 8

def event
  if params[:challenge]
    render plain: params[:challenge]
  else
    EventSubEvents.instrument(verified_event)
    head :ok
  end
rescue EventSubEvents::SignatureVerificationError => e
  render plain: e, status: :bad_request
end