app/models/rt/user.rb
def authenticate(password:)
    if self.password[0..7] == '!bcrypt!'
      path = "#{Rails.root}/tmp/rt_cookies/#{id}/cookie"
      dirname = File.dirname(path)
      FileUtils.mkdir_p(dirname) unless File.directory?(dirname)

      client = RT_Client.new(server: ENV.fetch('RT_HOST'),
                             user: name,
                             pass: password,
                             cookies: dirname)

      correct = !client.show(1).empty?
      FileUtils.rm_rf(dirname)
      correct
    else
      (Digest::MD5.hexdigest password) == self.password
    end
  end
# Todo: Figure out if way to check passwords that have been processed with perl bcrypt.
Figure out if way to check passwords that have been processed with perl bcrypt.
Figure out if way to check passwords that have been processed with perl bcrypt .
def authenticate(password:)
    if self.password[0..7] == '!bcrypt!'
      path = "#{Rails.root}/tmp/rt_cookies/#{id}/cookie"
      dirname = File.dirname(path)
      FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
      client = RT_Client.new(server: ENV.fetch('RT_HOST'),
                             user: name,
                             pass: password,
                             cookies: dirname)
      correct = !client.show(1).empty?
      FileUtils.rm_rf(dirname)
      correct
    else
      (Digest::MD5.hexdigest password) == self.password
    end
  end
def authenticate ( password : ) if self . password [ 0 .. 7 ] == '!bcrypt!' path = "#{Rails.root}/tmp/rt_cookies/#{id}/cookie" dirname = File . dirname ( path ) FileUtils . mkdir_p ( dirname ) unless File . directory? ( dirname ) client = RT_Client . new ( server : ENV . fetch ( 'RT_HOST' ) , user : name , pass : password , cookies : dirname ) correct = ! client . show ( 1 ) . empty? FileUtils . rm_rf ( dirname ) correct else ( Digest :: MD5 . hexdigest password ) == self . password end end
Todo: Figure out if way to check passwords that have been processed with perl bcrypt.
Todo : Figure out if way to check passwords that have been processed with perl bcrypt .
password