jwt.js 243 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 const jwt = require("jsonwebtoken"); const jwtGenerator = (id) => { // https://github.com/auth0/node-jsonwebtoken const token = jwt.sign({ id }, JWT_SECRET, { expiresIn: "2 days" }); return token; }; module.exports = { jwtGenerator };