Clean
This commit is contained in:
@@ -66,10 +66,8 @@ router.post('/login', requestLimiter, async (req, res) => {
|
||||
router.post('/verify', requestLimiter, async (req, res) => {
|
||||
const token = req.headers.authorization;
|
||||
if (!token) return await respondWithStatus(res, 401, 'No token provided');
|
||||
console.log(await jwt.verify(token, process.env.JWT_SECRET));
|
||||
try {
|
||||
const decoded = jwt.verify(token, process.env.JWT_SECRET);
|
||||
console.log(decoded);
|
||||
const [rows] = await pool.execute(
|
||||
'SELECT * FROM users WHERE id = ? LIMIT 1', [decoded.userId],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user