📌  相关文章
📜  使用护照 jwt 将令牌设置为过期. - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:03.240000             🧑  作者: Mango

代码示例1
const jwt = require('jsonwebtoken');

// in your login route
router.post('/login', (req, res) => {
  // do whatever you do to handle authentication, then issue the token:

  const token = jwt.sign(req.user, 's00perS3kritCode', { expiresIn: '30m' });
  res.send({ token });
});