feat: set expiresIn to 12h for login
This commit is contained in:
@@ -47,7 +47,7 @@ router.post('/login', async (req, res) => {
|
|||||||
const match = await comparePassword(password, user.password)
|
const match = await comparePassword(password, user.password)
|
||||||
if (!match) return res.status(400).send('Invalid email or 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
|
// return user and token to client, exclude hashed password
|
||||||
if (user) {
|
if (user) {
|
||||||
|
|||||||
Reference in New Issue
Block a user