registrations_controller.rb 450 B

1234567891011121314
  1. class RegistrationsController < Devise::RegistrationsController
  2. prepend_before_action :check_captcha, only: [:create] # Change this to be any actions you want to protect.
  3. private
  4. def check_captcha
  5. unless verify_recaptcha
  6. self.resource = resource_class.new sign_up_params
  7. resource.validate # Look for any other validation errors besides Recaptcha
  8. set_minimum_password_length
  9. respond_with resource
  10. end
  11. end
  12. end