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.
This commit is contained in:
Leni Kadali 2025-01-09 17:24:03 +03:00
parent 22340a8035
commit f995efb501
1 changed files with 10 additions and 4 deletions

View File

@ -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