Sha256: 735a8b98cfc6a7497efd0bdd7dc965098f4478403cb4d1329306b2c4045b0b79

Contents?: true

Size: 807 Bytes

Versions: 1

Compression:

Stored size: 807 Bytes

Contents

module DeviseSecurityExtension::Patches
  module PasswordsControllerCaptcha
    extend ActiveSupport::Concern
    included do
      define_method :create do
        if ((defined? verify_recaptcha) && (verify_recaptcha
        params[:captcha])) or ((defined? valid_captcha?) && (valid_captcha?
        params[:captcha]))
          self.resource = resource_class.send_reset_password_instructions(params[resource_name])
          if successfully_sent?(resource)
            respond_with({}, :location => new_session_path(resource_name))
          else
            respond_with(resource)
          end
        else
          flash[:alert] = t('devise.invalid_captcha') if is_navigational_format?
          respond_with({}, :location => new_password_path(resource_name))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devise_security_extension-0.10.0 lib/devise_security_extension/patches/passwords_controller_captcha.rb