add update settings method, remove all env var references possible

This commit is contained in:
Alex Holliday committed 2024-09-26 14:37:11 +08:00
1 parent 992bf099fa
commit 11b97ab3b4
17 files changed
+149 -36

No files matched your search

+2 -1
View File
@@ -163,7 +163,8 @@ const updateChecksTTL = async (req, res, next) => {
try {
// Get user's teamId
const token = getTokenFromHeaders(req.headers);
const { teamId } = jwt.verify(token, process.env.JWT_SECRET);
const { jwtSecret } = req.settingsService.getSettings();
const { teamId } = jwt.verify(token, jwtSecret);
const ttl = parseInt(req.body.ttl, 10) * SECONDS_PER_DAY;
await req.db.updateChecksTTL(teamId, ttl);
return res.status(200).json({