Files

Merb::Authentication::Mixins::SaltedUser::InstanceMethods

Public Instance Methods

authenticated?(password) click to toggle source
# File lib/merb-auth-more/mixins/salted_user.rb, line 58
def authenticated?(password)
  crypted_password == encrypt(password)
end
encrypt(password) click to toggle source
# File lib/merb-auth-more/mixins/salted_user.rb, line 62
def encrypt(password)
  self.class.encrypt(password, salt)
end
encrypt_password() click to toggle source
# File lib/merb-auth-more/mixins/salted_user.rb, line 70
def encrypt_password
  return if password.blank?
  self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{Merb::Authentication::Strategies::Basic::Base.login_param}--") if salt.blank?
  self.crypted_password = encrypt(password)
end
password_required?() click to toggle source
# File lib/merb-auth-more/mixins/salted_user.rb, line 66
def password_required?
  crypted_password.blank? || !password.blank?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.