lib/sorcery/model/submodules/brute_force_protection.rb
# Called by the controller to increment the failed logins counter.
# Calls 'lock!' if login retries limit was reached.
Called by the controller to increment the failed logins counter.
Calls 'lock!' if login retries limit was reached.
Called by the controller to increment the failed logins counter . Calls ' lock! ' if login retries limit was reached .
def lock!
            config = sorcery_config
            self.send(:"#{config.lock_expires_at_attribute_name}=", Time.now.in_time_zone + config.login_lock_time_period)
            unless config.unlock_token_mailer_disabled || config.unlock_token_mailer.nil?
              self.send(:"#{config.unlock_token_attribute_name}=", TemporaryToken.generate_random_token) 
              send_unlock_token_email!
            end
            self.save!(:validate => false)
          end
def lock! config = sorcery_config self . send ( :" #{ config . lock_expires_at_attribute_name } = " , Time . now . in_time_zone + config . login_lock_time_period ) unless config . unlock_token_mailer_disabled || config . unlock_token_mailer . nil? self . send ( :" #{ config . unlock_token_attribute_name } = " , TemporaryToken . generate_random_token ) send_unlock_token_email! end self . save! ( :validate => false ) end
Called by the controller to increment the failed logins counter.
Called by the controller to increment the failed logins counter .