Sha256: 67261f921d776e5198e6b300a9821366b7b61b43d618a9d6fb528ae48cf3f5b4
Contents?: true
Size: 504 Bytes
Versions: 280
Compression:
Stored size: 504 Bytes
Contents
class Caboose::Authenticator def authenticate(username, password) resp = Caboose::StdClass.new( 'error' => nil, 'user' => nil ) pass = Digest::SHA1.hexdigest(Caboose::salt + password) resp.user = Caboose::User.where(:username => username, :password => pass).first if (resp.user.nil?) resp.user = Caboose::User.where(:email => username, :password => pass).first end resp.error = "Invalid credentials" if resp.user.nil? return resp end end
Version data entries
280 entries across 280 versions & 1 rubygems