Module: Nyauth::Authenticatable::ClassMethods
- Defined in:
- app/models/concerns/nyauth/authenticatable.rb
Instance Method Summary collapse
Instance Method Details
#authenticate(given_email, given_password) ⇒ Object
12 13 14 15 16 17 |
# File 'app/models/concerns/nyauth/authenticatable.rb', line 12 def authenticate(given_email, given_password) record = where(email: given_email).last return nil unless record record.verify_password?(given_password) ? record : nil end |