lib/castronaut/adapters/restful_authentication/user.rb in relevance-castronaut-0.3.6 vs lib/castronaut/adapters/restful_authentication/user.rb in relevance-castronaut-0.4.1
- old
+ new
@@ -20,14 +20,13 @@
def self.secure_digest(*args)
Digest::SHA1.hexdigest(args.flatten.join('--'))
end
def self.find_by_login(login)
- user = find(:first, :conditions => { :login => login })
- return nil if user.nil?
-
if Castronaut.config.cas_adapter.has_key?('extra_authentication_conditions')
- return find(:first, :conditions => ["login = ? AND #{Castronaut.config.cas_adapter['extra_authentication_conditions']}", login])
+ find(:first, :conditions => ["login = ? AND #{Castronaut.config.cas_adapter['extra_authentication_conditions']}", login])
+ else
+ find(:first, :conditions => { :login => login })
end
end
def self.authenticate(username, password)
if user = find_by_login(username)