Module: Sorcery::Model::Submodules::BruteForceProtection::InstanceMethods

Defined in:
lib/sorcery/model/submodules/brute_force_protection.rb

Instance Method Summary collapse

Instance Method Details

#register_failed_login!Object

Called by the controller to increment the failed logins counter. Calls ‘lock!’ if login retries limit was reached.



45
46
47
48
49
50
51
# File 'lib/sorcery/model/submodules/brute_force_protection.rb', line 45

def register_failed_login!
  config = sorcery_config
  return if !unlocked?
  self.increment(config.failed_logins_count_attribute_name)
  save!
  self.lock! if self.send(config.failed_logins_count_attribute_name) >= config.
end