From a1f2b7ccfbd6b02d7d7829c43bdc0b259ee29a33 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Wed, 26 Jul 2023 03:59:04 +0000 Subject: [PATCH] Getting more detail about response from ReCaptcha v3 --- app/controllers/application_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6855cce..896c942 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -17,6 +17,7 @@ class ApplicationController < BaseController response = Net::HTTP.get_response(uri) json = JSON.parse(response.body) # json['success'] && json['score'] > RECAPTCHA_MINIMUM_SCORE && json['action'] == recaptcha_action + puts json.inspect json['success'] && json['score'] > RECAPTCHA_MINIMUM_SCORE end @@ -657,7 +658,7 @@ class ApplicationController < BaseController # send the confirmation email and make sure it get sent as quickly as possible def send_confirmation(confirmation) - puts = lookup_context.find_all(params[:action], params[:controller]).inspect + # puts lookup_context.find_all(params[:action], params[:controller]).inspect unless verify_recaptcha?(params[:recaptcha_token], 'sign_in') flash.now[:error] = 'recaptcha.errors.verification_failed'