From 47cd545ac241bb0f4d435b0f1a89292cb7b990e4 Mon Sep 17 00:00:00 2001 From: F04C Date: Wed, 18 Sep 2024 22:09:45 +0800 Subject: [PATCH] updated the expiration of token from 1h to 1day --- api/routes/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/routes/user.js b/api/routes/user.js index c5ddec8..3cc228f 100644 --- a/api/routes/user.js +++ b/api/routes/user.js @@ -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");