diff options
Diffstat (limited to 'lib/api/integrations/slack/concerns/verifies_request.rb')
-rw-r--r-- | lib/api/integrations/slack/concerns/verifies_request.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/api/integrations/slack/concerns/verifies_request.rb b/lib/api/integrations/slack/concerns/verifies_request.rb new file mode 100644 index 00000000000..b96f02e4cde --- /dev/null +++ b/lib/api/integrations/slack/concerns/verifies_request.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module API + class Integrations + module Slack + module Concerns + module VerifiesRequest + extend ActiveSupport::Concern + + included do + before { verify_slack_request! } + + helpers do + def verify_slack_request! + unauthorized! unless Request.verify!(request) + end + end + end + end + end + end + end +end |