Skip to content

Commit

Permalink
Merge pull request #2847 from sciencehistory/improve_turnstile_logging
Browse files Browse the repository at this point in the history
Add logging of turnstile pass, and include protected url in logging
  • Loading branch information
jrochkind authored Jan 16, 2025
2 parents cd96b8e + 1b0c116 commit 7900cda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/bot_detect_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ def verify_challenge
if result["success"]
# mark it as succesful in session, and record time. They do need a session/cookies
# to get through the challenge.
Rails.logger.info("#{self.class.name}: Cloudflare Turnstile validation passed api (#{request.remote_ip}, #{request.user_agent}): #{request.url}")
session[self.session_passed_key] = Time.now.utc.iso8601
else
Rails.logger.warn("#{self.class.name}: Cloudflare Turnstile validation failed (#{request.remote_ip}, #{request.user_agent}): #{result}")
Rails.logger.warn("#{self.class.name}: Cloudflare Turnstile validation failed (#{request.remote_ip}, #{request.user_agent}): #{result}: #{request.url}")
end

# let's just return the whole thing to client? Is there anything confidential there?
Expand Down

0 comments on commit 7900cda

Please sign in to comment.