mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-07 09:01:13 -05:00
fix(api): use req, not _req when logging (#59181)
This commit is contained in:
committed by
GitHub
parent
4db30c47d0
commit
e74bc4dfed
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user