learn node+koa developer is writing a simple example and using token
app.use(jwtKoa({secret}).unless({
path: [/^\/adduser/, /^\/login/] //jwt
}))
when you log in, return to the frontend token and set it to be valid for one hour, but if the token fails, you don"t want the user to log in again to get the token, but want to refresh the token. What should I do?
jwt.sign({
name: islogin[0].username,
// token
exp: 60 * 60, // 60 seconds * 60 minutes = 1 hour
}, secret)