Sha256: 7b92b088d39bc8129e652e0134c52eb792963ef37f3b0c41a10b6e0de44e87fb

Contents?: true

Size: 727 Bytes

Versions: 11

Compression:

Stored size: 727 Bytes

Contents

module DeviseSecurityExtension::Patches
  module ConfirmationsControllerCaptcha
    extend ActiveSupport::Concern
    included do
      define_method :create do
        if valid_captcha? 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

11 entries across 11 versions & 1 rubygems

Version Path
devise_security_extension-0.9.2 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.9.1 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.8.4 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.8.3 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.8.1 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.8.0 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.7.2 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.7.1 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.7.0 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.6.2 lib/devise_security_extension/patches/confirmations_controller_captcha.rb
devise_security_extension-0.6.1 lib/devise_security_extension/patches/confirmations_controller_captcha.rb