created(auth) auth middleware has been added and used on person route

This commit is contained in:
Yusuf İpek
2021-07-24 11:04:58 +03:00
parent 84b60d6fb3
commit 2de9d3594a
5 changed files with 216 additions and 8 deletions
+7
View File
@@ -0,0 +1,7 @@
const jwt = require("jsonwebtoken");
module.exports = function () {
const token = jwt.sign({ isAdmin: true }, process.env.rememberMe_jwtKey, {
expiresIn: "30d",
});
return token;
};