passwords_controller.rb 370 B

12345678910111213
  1. class PasswordsController < Devise::PasswordsController
  2. prepend_before_action :check_captcha, only: [:create]
  3. private
  4. def check_captcha
  5. unless verify_recaptcha
  6. self.resource = resource_class.new
  7. resource.validate # Look for any other validation errors besides Recaptcha
  8. respond_with_navigational(resource) { render :new }
  9. end
  10. end
  11. end