# app/controllers/users/registrations_controller.rb
prepend_before_action :check_listing_exists, :check_captcha, only: [:create]
def check_captcha
return if verify_recaptcha # verify_recaptcha(action: 'signup') for v3
self.resource = resource_class.new sign_up_params
resource.validate # Look for any other validation errors besides reCAPTCHA
set_minimum_password_length
respond_with_navigational(resource) do
flash.discard(:recaptcha_error) # We need to discard flash to avoid showing it on the next page reload
render :new
end
end
Upon submission of the recaptcha, it takes me to the login page which is weird. I tried to debug by adding a debugger on #check_captcha but it doesn't seem to reach there.
Can you let me know what could be the issue?
Note: I also tried this tutorial It didn't help me either!
I followed the documentation to implement
invisible_repcatcha_tags
on my app but it doesn't seem to work for some reason.Note: It's a single form.
Here's my setup
Upon submission of the recaptcha, it takes me to the login page which is weird. I tried to debug by adding a debugger on
#check_captcha
but it doesn't seem to reach there.Can you let me know what could be the issue?
Note: I also tried this tutorial It didn't help me either!