From f995efb501fccbceee7310ce4eebedf82dd86253 Mon Sep 17 00:00:00 2001 From: Leni Kadali <52788034+lenikadali@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:24:03 +0300 Subject: [PATCH] Update confirm_captcha check to use either method Updated confirm_captcha check to use either method available depending on whether it is mCaptcha or hCaptcha enabled. Currently doesn't work since we need to change it to be compatible with an if/elsif statement. Adding it now so that we don't forget update it during cleanup/changes related to feedback from testing. --- app/controllers/auth/confirmations_controller.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb index bf5c84ccf4..b6e2fc3ad1 100644 --- a/app/controllers/auth/confirmations_controller.rb +++ b/app/controllers/auth/confirmations_controller.rb @@ -29,10 +29,16 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController end def confirm_captcha - check_captcha! do |message| - flash.now[:alert] = message - render :captcha - return + if Rails.configuration.x.captcha.mcaptcha_secret_key.present? + check_mcaptcha! do |message| + flash.now[:alert] = message + render :captcha + return + else + check_mcaptcha! do |message| + flash.now[:alert] = message + render :captcha + return end show