Skip to content

Instantly share code, notes, and snippets.

@esale
esale / include_recaptcha_score.rb
Last active December 22, 2019 15:38
Suggested addition to /lib/recaptcha/adapters/controller_methods.rb in order to being able to retrieve recaptcha score and other values from response.
# This is based on verify_recaptcha:
# https://github.com/ambethia/recaptcha/blob/c9ef2815a3c3d7b8e0abd4b5b85207a34db23cc0/lib/recaptcha/adapters/controller_methods.rb#L10
#
# Your private API can be specified in the +options+ hash or preferably
# using the Configuration.
#
# Example usage: recaptcha_response({secret_key: "insert_your_secret_key_from_google", action: "contact"})
#
# Example response:
#