feat: set expiresIn to 12h for register

This commit is contained in:
karishmas6
2024-10-07 18:49:14 +05:30
parent 7633e17c7a
commit 2fa947fca6

View File

@@ -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