Class: Caboose::Authenticator
- Inherits:
-
Object
- Object
- Caboose::Authenticator
- Defined in:
- app/models/caboose/authenticator.rb
Instance Method Summary collapse
Instance Method Details
#authenticate(username, password) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'app/models/caboose/authenticator.rb', line 4 def authenticate(username, password) pass = Digest::SHA1.hexdigest(Caboose::salt + password) user = Caboose::User.where(:username => username, :password => pass).first if (user.nil?) user = Caboose::User.where(:email => username, :password => pass).first end return false if user.nil? return user end |