Method: KktShoppe::User.authenticate
- Defined in:
- app/models/kkt_shoppe/user.rb
.authenticate(email_address, password) ⇒ KktShoppe::User
Attempt to authenticate a user based on email & password. Returns the user if successful otherwise returns false.
41 42 43 44 45 46 |
# File 'app/models/kkt_shoppe/user.rb', line 41 def self.authenticate(email_address, password) user = self.where(:email_address => email_address).first return false if user.nil? return false unless user.authenticate(password) user end |