jwt.js 262 Bytes
const jwt = require("jsonwebtoken");

const jwtGenerator = (id) => {
  // https://github.com/auth0/node-jsonwebtoken
  const token = jwt.sign({ id }, process.env.JWT_SECRET, {
    expiresIn: "2 days",
  });
  return token;
};

module.exports = { jwtGenerator };