secrets_controller.rb 374 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. module Admin
  3. class Webhooks::SecretsController < BaseController
  4. before_action :set_webhook
  5. def rotate
  6. authorize @webhook, :rotate_secret?
  7. @webhook.rotate_secret!
  8. redirect_to admin_webhook_path(@webhook)
  9. end
  10. private
  11. def set_webhook
  12. @webhook = Webhook.find(params[:webhook_id])
  13. end
  14. end
  15. end