mirror of
https://github.com/yusufipk/RememberMe.git
synced 2026-09-11 10:56:07 +00:00
13 lines
276 B
JavaScript
13 lines
276 B
JavaScript
const jwt = require("jsonwebtoken");
|
|
module.exports.createToken = function () {
|
|
const token = jwt.sign({ isAdmin: true }, process.env.rememberMe_jwtKey, {
|
|
expiresIn: "30d",
|
|
});
|
|
|
|
if (!process.env.NODE_ENV === "test") {
|
|
console.log(token);
|
|
}
|
|
|
|
return token;
|
|
};
|