From 2fa947fca6a4677aaf0137b9341c6bf0c8cea4e7 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 7 Oct 2024 18:49:14 +0530 Subject: [PATCH] feat: set expiresIn to 12h for register --- 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 c33409c2..59be6d1a 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -24,7 +24,7 @@ router.post('/register', async (req, res) => { const user = await User.create({ email, password: hashedPassword }); - 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' }); user.password = undefined as unknown as string res.cookie('token', token, { httpOnly: true