Sha256: 5ae68ce0efb56d803fb88bdf10952d9166a875aa72a8db594d267469fd91bbce

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

module DeviseSecurity
  module Patches
    autoload :ControllerCaptcha, 'devise-security/patches/controller_captcha'
    autoload :ControllerSecurityQuestion, 'devise-security/patches/controller_security_question'

    class << self
      def apply
        Devise::PasswordsController.send(:include, Patches::ControllerCaptcha) if Devise.captcha_for_recover || Devise.security_question_for_recover
        Devise::UnlocksController.send(:include, Patches::ControllerCaptcha) if Devise.captcha_for_unlock || Devise.security_question_for_unlock
        Devise::ConfirmationsController.send(:include, Patches::ControllerCaptcha) if Devise.captcha_for_confirmation

        Devise::PasswordsController.send(:include, Patches::ControllerSecurityQuestion) if Devise.security_question_for_recover
        Devise::UnlocksController.send(:include, Patches::ControllerSecurityQuestion) if Devise.security_question_for_unlock
        Devise::ConfirmationsController.send(:include, Patches::ControllerSecurityQuestion) if Devise.security_question_for_confirmation

        Devise::RegistrationsController.send(:include, Patches::ControllerCaptcha) if Devise.captcha_for_sign_up
        Devise::SessionsController.send(:include, Patches::ControllerCaptcha) if Devise.captcha_for_sign_in
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
devise-security-0.17.0 lib/devise-security/patches.rb
devise-security-0.16.0 lib/devise-security/patches.rb
devise-security-0.15.0 lib/devise-security/patches.rb
devise-security-0.14.3 lib/devise-security/patches.rb
devise-security-0.14.2 lib/devise-security/patches.rb
devise-security-0.14.1 lib/devise-security/patches.rb
devise-security-0.14.0 lib/devise-security/patches.rb
devise-security-0.14.0.rc1 lib/devise-security/patches.rb
devise-security-0.13.0 lib/devise-security/patches.rb