auto(agent): Added error handling to auth middleware

This commit is contained in:
OpenClaw 2026-03-06 16:49:47 +00:00
parent 29d1532c1f
commit f03b758e18
107 changed files with 1962 additions and 1 deletions

View file

@ -9,7 +9,7 @@ export const requireAuth = (req, res, next) => {
try {
req.user = jwt.verify(token, process.env.JWT_SECRET);
next();
} catch {
} catch (err) {
res.status(401).json({ error: 'Invalid token' });
}
};