Sha256: 9045bf93a7058d17ac726ee63e4f76120c179c7e1ca2d9e5fb8e0046fcab974f
Contents?: true
Size: 892 Bytes
Versions: 13
Compression:
Stored size: 892 Bytes
Contents
# typed: false # frozen_string_literal: true class <%= capital_plug_name %>Controller < ApplicationController include Authable include Constants before_action :webhook_from_<%= plug_name %>?, only: [:webhook] before_action :<%= plug_name %>_calling_back?, only: [:callback] def webhook body = request.body.read payload = JSON.parse(body, symbolize_names: true) # TODO: Get the event and action that triggered the webhook # # Then, queue up some work to be done in a background job okay end def callback code = params[:code] state = params[:state] state_obj = parse_state(state) plug_installation_id = state_obj.fetch(:plug_installation_id, "") redirect_to = state_obj.fetch(:redirect_to, "") # TODO: Store access credentials you've been given back in Yetto redirect_to(redirect_to, allow_other_host: true) end end
Version data entries
13 entries across 13 versions & 1 rubygems