claims_controller.rb 491 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. class ActivityPub::ClaimsController < ActivityPub::BaseController
  3. include SignatureVerification
  4. include AccountOwnedConcern
  5. skip_before_action :authenticate_user!
  6. before_action :require_signature!
  7. before_action :set_claim_result
  8. def create
  9. render json: @claim_result, serializer: ActivityPub::OneTimeKeySerializer
  10. end
  11. private
  12. def set_claim_result
  13. @claim_result = ::Keys::ClaimService.new.call(@account.id, params[:id])
  14. end
  15. end