Skip to content

p137 - Extra parameter in method call? #12

@mikbe

Description

@mikbe

On page 137 of Chapter 5 should the self#authenticate method be changed from this:

def self.authenticate(username, password) 
  user = new(username, password)
  user.authenticate(password)
rescue Net::LDAP::LdapError => e 
  ActiveRecord::Base.logger.debug "!!! LDAP Error: #{e.message} !!!" 
  false
end

To this since the initialize method only takes one parameter?

def self.authenticate(username, password) 
  user = new(username) # <= Remove the password parameter
  user.authenticate(password)
rescue Net::LDAP::LdapError => e 
  ActiveRecord::Base.logger.debug "!!! LDAP Error: #{e.message} !!!" 
  false
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions