PasswordExpirable takes care of change password after
set a fake datetime so a password change is needed
# File lib/devise_security_extension/models/password_expirable.rb, line 32 def need_change_password if self.class.expire_password_after.is_a? Fixnum or self.class.expire_password_after.is_a? Float self.password_changed_at = self.class.expire_password_after.ago end # is date not set it will set default to need set new password next login need_change_password if self.password_changed_at.nil? self.password_changed_at end
set a fake datetime so a password change is needed and save the record
# File lib/devise_security_extension/models/password_expirable.rb, line 24 def need_change_password! if self.class.expire_password_after.is_a? Fixnum or self.class.expire_password_after.is_a? Float need_change_password self.save(:validate => false) end end
is an password change required?
# File lib/devise_security_extension/models/password_expirable.rb, line 15 def need_change_password? if self.class.expire_password_after.is_a? Fixnum or self.class.expire_password_after.is_a? Float self.password_changed_at.nil? or self.password_changed_at < self.class.expire_password_after.ago else false end end