This commit is contained in:
2023-12-07 23:48:35 +01:00
parent 5d2be6584e
commit 99eb7828ea

View File

@@ -5,7 +5,7 @@ import { pool } from './database.js';
// Generate a new JWT
const generateToken = async (userId, password) => {
return token = await jwt.sign({ userId: userId, password: password }, process.env.JWT_SECRET, { expiresIn: '7d' });
return await jwt.sign({ userId: userId, password: password }, process.env.JWT_SECRET, { expiresIn: '7d' });
};
// Middleware to verify the JWT and set req.userId