This commit is contained in:
2023-12-07 23:47:47 +01:00
parent 85baf6a724
commit 5d2be6584e

View File

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