fix(api): use req, not _req when logging (#59181)

This commit is contained in:
Oliver Eyton-Williams
2025-03-08 15:53:54 +01:00
committed by GitHub
parent 4db30c47d0
commit e74bc4dfed

View File

@@ -26,9 +26,9 @@ const csrf: FastifyPluginCallback = (fastify, _options, done) => {
});
// All routes except signout should add a CSRF token to the response
fastify.addHook('onRequest', (_req, reply, done) => {
const logger = fastify.log.child({ _req });
const isSignout = _req.url === '/signout' || _req.url === '/signout/';
fastify.addHook('onRequest', (req, reply, done) => {
const logger = fastify.log.child({ req });
const isSignout = req.url === '/signout' || req.url === '/signout/';
if (!isSignout) {
logger.debug('Adding CSRF token to response');