From 29b75f27f4e1084c4c1c126cc747aadf8320b48b Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 4 Dec 2023 05:58:40 +0530 Subject: [PATCH] added expires in 365d --- apps/server/dist/routes/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/dist/routes/auth.js b/apps/server/dist/routes/auth.js index b84ecf3..e29c801 100644 --- a/apps/server/dist/routes/auth.js +++ b/apps/server/dist/routes/auth.js @@ -48,7 +48,7 @@ router.post('/login', (req, res) => __awaiter(void 0, void 0, void 0, function* const { username, password } = req.body; const user = yield db_1.User.findOne({ username, password }); if (user) { - const token = jsonwebtoken_1.default.sign({ id: user._id }, index_1.SECRET, {}); + const token = jsonwebtoken_1.default.sign({ id: user._id }, index_1.SECRET, { expiresIn: '365d' }); res.json({ message: 'Logged in successfully', token }); } else {