Files

Merb::Authentication::Mixins::SaltedUser::MongoidClassMethods

Public Class Methods

extended(base) click to toggle source
    # File lib/merb-auth-more/mixins/salted_user/mongoid_salted_user.rb, line 5
 5:         def self.extended(base)
 6:           base.class_eval do
 7: 
 8:             field :crypted_password, :type => String
 9: 
10:             if Merb::Authentication::Mixins::SaltedUser > base
11:               field :salt, :type => String
12:             end
13: 
14:             validates_presence_of :password, :if => proc{|m| m.password_required?}
15:             validates_confirmation_of :password, :if => proc{|m| m.password_required?}
16: 
17:             before_save   :encrypt_password
18:           end # base.class_eval
19: 
20:         end

Public Instance Methods

authenticate(login, password) click to toggle source
    # File lib/merb-auth-more/mixins/salted_user/mongoid_salted_user.rb, line 22
22:         def authenticate(login, password)
23:           @u = first(:conditions => { Merb::Authentication::Strategies::Basic::Base.login_param => login })
24:           @u && @u.authenticated?(password) ? @u : nil
25:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.