Fix jwt-token
This commit is contained in:
@@ -70,7 +70,10 @@ async function authenticateToken(req, res, next) {
|
||||
|
||||
next();
|
||||
} catch (error) {
|
||||
// Only log unexpected errors, not common JWT validation failures
|
||||
if (process.env.NODE_ENV !== 'test' || error.name === 'TypeError') {
|
||||
console.error('Token verification error:', error);
|
||||
}
|
||||
return res.status(401).json({
|
||||
success: false,
|
||||
message: 'Invalid token'
|
||||
|
||||
Reference in New Issue
Block a user