From 71c2dc7d2dc178bbc79db0fd9b4f7f655dba34c0 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween <5454374+emcsween@users.noreply.github.com> Date: Mon, 20 Jan 2025 09:02:35 -0500 Subject: [PATCH] Merge pull request #22970 from overleaf/em-log-user-id Add userId to request logs when user is logged in GitOrigin-RevId: c7c907375af20c83f2ac762aa634b8d8cd1d9404 --- .../app/src/Features/Authentication/AuthenticationController.js | 1 + 1 file changed, 1 insertion(+) diff --git a/services/web/app/src/Features/Authentication/AuthenticationController.js b/services/web/app/src/Features/Authentication/AuthenticationController.js index 0df10e0715..7a97d2ac9c 100644 --- a/services/web/app/src/Features/Authentication/AuthenticationController.js +++ b/services/web/app/src/Features/Authentication/AuthenticationController.js @@ -357,6 +357,7 @@ const AuthenticationController = { return AuthenticationController._redirectToLoginOrRegisterPage(req, res) } else { req.user = SessionManager.getSessionUser(req.session) + req.logger?.addFields({ userId: req.user._id }) return next() } }