mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(api): change csrf logLevel (#60371)
This commit is contained in:
committed by
GitHub
parent
7e76946a07
commit
7d420d9214
@@ -12,7 +12,7 @@ jest.mock('../utils/env', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
async function setupServer() {
|
async function setupServer() {
|
||||||
const fastify = Fastify();
|
const fastify = Fastify({ logger: true });
|
||||||
await fastify.register(cookies);
|
await fastify.register(cookies);
|
||||||
await fastify.register(csrf);
|
await fastify.register(csrf);
|
||||||
// @ts-expect-error - @fastify/csrf-protection needs to update their types
|
// @ts-expect-error - @fastify/csrf-protection needs to update their types
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const csrf: FastifyPluginCallback = (fastify, _options, done) => {
|
|||||||
// tokens since we know we can provide this one
|
// tokens since we know we can provide this one
|
||||||
getToken: req => req.headers[CSRF_HEADER] as string,
|
getToken: req => req.headers[CSRF_HEADER] as string,
|
||||||
cookieOpts: { signed: false, sameSite: 'strict' },
|
cookieOpts: { signed: false, sameSite: 'strict' },
|
||||||
logLevel: 'debug' // TODO: change to trace
|
logLevel: 'silent'
|
||||||
});
|
});
|
||||||
|
|
||||||
// All routes except signout should add a CSRF token to the response
|
// All routes except signout should add a CSRF token to the response
|
||||||
|
|||||||
Reference in New Issue
Block a user