Don't try to authenticate when the provided username is blank.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@656 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-11-26 01:57:21 +00:00
parent d4f0344ec3
commit 9179dbd16e

View file

@ -105,6 +105,7 @@ class User < ActiveRecord::Base
alias_method :prefs, :preference
def self.authenticate(login, pass)
return nil if login.blank?
candidate = find(:first, :conditions => ["login = ?", login])
return nil if candidate.nil?
if candidate.auth_type == 'database'