New Login form

This commit is contained in:
Min Zeya Phyo
2017-06-26 21:56:13 +06:30
parent 1f6a0eb1f6
commit b607154037
12 changed files with 154 additions and 19 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