fix: missing error logs in api

pull/249/head
Sylvie 1 year ago
parent 11d6f302f2
commit 2a6e78356f
No known key found for this signature in database
GPG Key ID: 75AB0FE5B983A3AF

@ -53,6 +53,7 @@ router.post('/setup', BodyParserJson(), async (req, res) => {
return res.json({ success: true }); return res.json({ success: true });
} catch (err: any) { } catch (err: any) {
log.error('Setup failed', err);
return res.status(400).json({ success: false, message: err.message }); return res.status(400).json({ success: false, message: err.message });
} }
}); });
@ -84,7 +85,7 @@ router.post('/login', rateLimiterMiddleware('login', UserConfig.config?.rateLimi
// Delete the pre-login path after successful login // Delete the pre-login path after successful login
if (success) delete req.session.ass?.preLoginPath; if (success) delete req.session.ass?.preLoginPath;
}) })
.catch((err) => res.status(400).json({ success: false, message: err.message })); .catch((err) => log.error(err).callback(() => res.status(400).json({ success: false, message: err.message })));
}); });
// todo: authenticate API endpoints // todo: authenticate API endpoints

Loading…
Cancel
Save