Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-06-27 10:16:28 +06:30
10 changed files with 149 additions and 11 deletions

View File

@@ -13,9 +13,9 @@ class Employee < ApplicationRecord
def self.login(emp_id, password)
user = Employee.find_by_emp_id(emp_id)
if (user)
user.authenticate(password)
#user.authenticate(password)
if (user)
if (user.authenticate(password))
user.generate_token
user.session_expiry = DateTime.now.utc + 30.minutes
user.session_last_login = DateTime.now.utc