Skip to content

Commit

Permalink
Update recpatcha minium score vi env variable. (#4859)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkinzer authored Jan 13, 2025
1 parent efffefa commit 2ec947a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/primo_central_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def recaptcha
# skip if nothing to query.
return if params["q"].blank? && params["f"].blank?

if !verify_recaptcha(action: @recaptcha_action, minimum_score: 0.9)
minimum_score |= ENV["RECAPTCHA_MINIMUM_SCORE"] || 0.9

if !verify_recaptcha(action: @recaptcha_action, minimum_score: minimum_score)
raise Recaptcha::VerifyError.new("recaptcha verification failed for #{@recaptcha_action}")
end
end
Expand Down

0 comments on commit 2ec947a

Please sign in to comment.