From 86ec6920aa2f7e6504b94c6b366c619c5e878175 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 7 Oct 2024 18:50:34 +0530 Subject: [PATCH] feat: set expiresIn to 12h for login --- server/src/routes/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/routes/auth.ts b/server/src/routes/auth.ts index 59be6d1a..170831a5 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -47,7 +47,7 @@ router.post('/login', async (req, res) => { const match = await comparePassword(password, user.password) if (!match) return res.status(400).send('Invalid email or password') - const token = jwt.sign({ id: user?.id }, process.env.JWT_SECRET as string, { expiresIn: '1h' }); + const token = jwt.sign({ id: user?.id }, process.env.JWT_SECRET as string, { expiresIn: '12h' }); // return user and token to client, exclude hashed password if (user) {