Test
This commit is contained in:
@@ -75,10 +75,9 @@ router.post('/verify', requestLimiter, async (req, res) => {
|
||||
|
||||
try {
|
||||
const decoded = jwt.verify(token, process.env.JWT_SECRET);
|
||||
req.userId = decoded.userId;
|
||||
|
||||
console.log(decoded);
|
||||
const [rows] = await pool.execute(
|
||||
'SELECT * FROM users WHERE id = ? LIMIT 1', [req.userId],
|
||||
'SELECT * FROM users WHERE id = ? LIMIT 1', [decoded.userId],
|
||||
);
|
||||
if (!rows.length) return await respondWithStatus(res, 404, 'User not found!');
|
||||
const passwordMatch = await Bun.password.verify(decoded.password, rows[0].password);
|
||||
|
||||
Reference in New Issue
Block a user