Sha256: b10cfe8247afd691fdfa7a252419d97af6c343a79e57639c4a9d5919852d2871
Contents?: true
Size: 428 Bytes
Versions: 18
Compression:
Stored size: 428 Bytes
Contents
module ValidateSignature extend ActiveSupport::Concern included do before_action do render file: "#{Rails.root}/public/404.html", layout: false, status: :not_found unless has_valid_signature? end end private def has_valid_signature? request.original_url.split('?')[0] == ActiveSupport::MessageVerifier.new(ENV.fetch('RAILS_MASTER_KEY', '')).verify(params[:signature]) rescue false end end
Version data entries
18 entries across 9 versions & 1 rubygems