increaed token period to 9 days
This commit is contained in:
@@ -20,13 +20,12 @@ async function login(req, res) {
|
||||
return res.status(401).json({ error: 'INVALID_CREDENTIALS' });
|
||||
if (user?.password_hash === 'o')
|
||||
return res.status(401).json({ error: 'MIGRATED_USER_HAS_NO_PASSWORD' });
|
||||
const token = generateToken(user.customer_no, '9d');
|
||||
const FirstTimeLogin = await authService.CheckFirstTimeLogin(customerNo);
|
||||
// For registration : if try to login first time after 7 days.
|
||||
if (FirstTimeLogin && dayjs(user.created_at).diff(currentTime, "day") > 8)
|
||||
return res.status(401).json({ error: 'Password Expired.Please Contact with Administrator' });
|
||||
|
||||
const token = generateToken(user.customer_no, '1d');
|
||||
const token = generateToken(user.customer_no, '9d');
|
||||
const loginPswExpiry = user.password_hash_expiry;
|
||||
const rights = {
|
||||
ibAccess: user.ib_access_level,
|
||||
|
||||
Reference in New Issue
Block a user