jwt.js 262 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 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 };