fix(api): adjust logging in bouncer, downgrade to trace (#59945)

This commit is contained in:
Mrugesh Mohapatra
2025-04-24 20:06:28 +05:30
committed by GitHub
parent 07c45a1ac4
commit 27689faf41
+5 -5
View File
@@ -21,8 +21,8 @@ const plugin: FastifyPluginCallback = (fastify, _options, done) => {
if (!req.user) {
const logger = fastify.log.child({ req });
logger.debug(
'User tried to access a protected route without being authenticated.'
logger.trace(
'Protected route accessed by unauthenticated user. Sent 401.'
);
await reply.status(401).send({
@@ -38,8 +38,8 @@ const plugin: FastifyPluginCallback = (fastify, _options, done) => {
async function (req: FastifyRequest, reply: FastifyReply) {
const logger = fastify.log.child({ req });
if (!req.user) {
logger.debug(
'User tried to access a protected route without being authenticated.'
logger.trace(
'Protected route accessed by unauthenticated user. Redirecting to login.'
);
const { origin } = getRedirectParams(req);
await reply.redirectWithMessage(origin, {
@@ -59,7 +59,7 @@ const plugin: FastifyPluginCallback = (fastify, _options, done) => {
const { returnTo } = getRedirectParams(req);
logger.debug(`User is being redirected to: ${returnTo}`);
logger.trace(`User ${req.user?.id} redirected to: ${returnTo}`);
await reply.redirect(returnTo);
}