Sha256: 014af996cfd51d4adc424a4d8653aaaa36dac876ae6f2d14ce93f7efb7f30ce5
Contents?: true
Size: 442 Bytes
Versions: 9
Compression:
Stored size: 442 Bytes
Contents
class CASino::TwoFactorAuthenticator < ActiveRecord::Base belongs_to :user scope :active, -> { where(active: true) } def self.cleanup self.delete_all(['(created_at < ?) AND active = ?', self.lifetime.ago, false]) end def self.lifetime CASino.config.two_factor_authenticator[:lifetime_inactive].seconds end def expired? !self.active? && (Time.now - (self.created_at || Time.now)) > self.class.lifetime end end
Version data entries
9 entries across 9 versions & 1 rubygems