Sha256: f8c6d7ae74c0100727c3877067d1843a4ff727583857ae9d8b651bdf33bb67a5

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

module DeviseSecurity::Patches
  module ConfirmationsControllerCaptcha
    extend ActiveSupport::Concern
    included do
      define_method :create do
        if valid_captcha_if_defined?(params[:captcha])
          self.resource = resource_class.send_confirmation_instructions(params[resource_name])

          if successfully_sent?(resource)
            respond_with({}, :location => after_resending_confirmation_instructions_path_for(resource_name))
          else
            respond_with(resource)
          end
        else
          flash[:alert] = t('devise.invalid_captcha') if is_navigational_format?
          respond_with({}, :location => new_confirmation_path(resource_name))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devise-security-0.11.1 lib/devise-security/patches/confirmations_controller_captcha.rb