You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
const jwt = require("jsonwebtoken");
|
|
require("dotenv").config();
|
|
|
|
function jwtGenerator(user_id) {
|
|
const payload = {
|
|
user: user_id,
|
|
};
|
|
return jwt.sign(payload, process.env.jwtSecret, { expiresIn: "1hr" });
|
|
}
|
|
|
|
module.exports = jwtGenerator;
|