fix(routes): restore ctx access in 15 route files broken by Phase 2.1 refactor

The modular refactor changed function signatures to destructured deps but
left internal ctx.* references intact, causing "ctx is not defined" errors
on /api/config, /api/logo, and many other endpoints. Also implements
loadTotpConfig and saveTotpConfig which were left as stubs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 03:01:29 -07:00
parent 01bf01d043
commit f865790fe1
16 changed files with 62 additions and 37 deletions

View File

@@ -17,7 +17,8 @@ const { logError } = require('../../src/utils/logging');
* @param {Object} deps.helpers - Arr helpers module
* @returns {express.Router}
*/
module.exports = function({ credentialManager, servicesStateManager, docker, fetchT, asyncHandler, errorResponse, log, helpers, notification, safeErrorMessage }) {
module.exports = function(ctx) {
const { credentialManager, servicesStateManager, docker, fetchT, asyncHandler, errorResponse, log, helpers, notification, safeErrorMessage } = ctx;
const router = express.Router();
// Ctx shim for backward compatibility