Skip to content

Commit

Permalink
remove legacy tracking param
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Jun 24, 2024
1 parent 4552c72 commit 9539c47
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions app/controllers/api/submitter_email_clicks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class SubmitterEmailClicksController < ApiBaseController
def create
submitter = Submitter.find_by!(slug: params[:submitter_slug])

if params[:t] == SubmissionEvents.build_tracking_param(submitter, 'click_email') ||
params[:t] == SubmissionEvents.build_tracking_param_legacy(submitter, 'click_email')
if params[:t] == SubmissionEvents.build_tracking_param(submitter, 'click_email')
SubmissionEvents.create_with_tracking_data(submitter, 'click_email', request)
end

Expand Down
6 changes: 0 additions & 6 deletions lib/submission_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ module SubmissionEvents

module_function

def build_tracking_param_legacy(submitter, event_type = 'click_email')
Base64.urlsafe_encode64(
[submitter.slug, event_type].join(':')
).first(TRACKING_PARAM_LENGTH)
end

def build_tracking_param(submitter, event_type = 'click_email')
Base64.urlsafe_encode64(
Digest::SHA1.digest([submitter.slug, event_type, Rails.application.secret_key_base].join(':'))
Expand Down

0 comments on commit 9539c47

Please sign in to comment.