Module: Authlogic::Session::BruteForceProtection::InstanceMethods

Defined in:
lib/novelys_authlogic/session/brute_force_protection.rb

Overview

The methods available for an Authlogic::Session::Base object that make up the brute force protection feature.

Instance Method Summary collapse

Instance Method Details

#being_brute_force_protected?Boolean

Returns true when the consecutive_failed_logins_limit has been exceeded and is being temporarily banned. Notice the word temporary, the user will not be permanently banned unless you choose to do so with configuration. By default they will be banned for 2 hours. During that 2 hour period this method will return true.

Returns:

  • (Boolean)


59
60
61
62
# File 'lib/novelys_authlogic/session/brute_force_protection.rb', line 59

def being_brute_force_protected?
  exceeded_failed_logins_limit? && ( <= 0 ||
    (attempted_record.respond_to?(:updated_at) && attempted_record.updated_at >= .seconds.ago))
end