reduce exp time

This commit is contained in:
monoid 2021-01-10 18:02:07 +09:00
parent fa68bc1685
commit 8219606297

View File

@ -61,7 +61,7 @@ export const createLoginMiddleware = (knex: Knex)=>{
const payload = sign({ const payload = sign({
username: user.username, username: user.username,
permission: userPermission permission: userPermission
},secretKey,{expiresIn:'3d'}); },secretKey,{expiresIn:'3h'});
ctx.cookies.set(loginTokenName,payload,{httpOnly:true, secure: !setting.localmode,sameSite:'strict'}); ctx.cookies.set(loginTokenName,payload,{httpOnly:true, secure: !setting.localmode,sameSite:'strict'});
ctx.body = {ok:true, username: user.username, permission: userPermission} ctx.body = {ok:true, username: user.username, permission: userPermission}
console.log(`${username} logined`); console.log(`${username} logined`);