diff --git a/src/controllers/admin/dashboard.js b/src/controllers/admin/dashboard.js index b84983f0f2..0e7dd36d10 100644 --- a/src/controllers/admin/dashboard.js +++ b/src/controllers/admin/dashboard.js @@ -422,7 +422,7 @@ dashboardController.submitBugReport = async function (req, res) { const sanitizedDescription = validator.escape(description); const timestamp = Date.now(); - const user = email ? email : 'Anonymous'; // Assuming req.user contains the user information + const user = req.user ? req.user.username : 'Anonymous'; // Assuming req.user contains the user information // Add the bug report to the in-memory array bugLogs.push({ user, description: sanitizedDescription, timestamp });