Module: Workarea::User::Login::ClassMethods
- Defined in:
- app/models/workarea/user/login.rb
Instance Method Summary collapse
Instance Method Details
#find_for_login(email, password) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/workarea/user/login.rb', line 15 def find_for_login(email, password) return nil if email.blank? || password.blank? user = find_by_email(email) return nil unless user if user.authenticate(password) user else user.login_failure! nil end end |
#login_locked?(email) ⇒ Boolean
29 30 31 32 33 34 |
# File 'app/models/workarea/user/login.rb', line 29 def login_locked?(email) user = find_by_email(email) return false unless user user.login_locked? end |