updated the expiration of token from 1h to 1day

This commit is contained in:
2024-09-18 22:09:45 +08:00
parent 0c9e1a4216
commit 47cd545ac2
+1 -1
View File
@@ -28,7 +28,7 @@ router.post("/login", (req, res) => {
let jwtSecretKey = process.env.JWT_SECRET_KEY || "defaultSecretKey";
let data = { userId: user.id, username: user.username };
const token = jwt.sign(data, jwtSecretKey, { expiresIn: "1h" });
const token = jwt.sign(data, jwtSecretKey, { expiresIn: "1d" });
return res.json({ token });
} else {
return res.status(401).send("Invalid credentials");