From 8b3f03397f68c5b52a9f4f281e369519a6d5eb2b Mon Sep 17 00:00:00 2001 From: Hari Om Date: Sat, 23 May 2026 22:19:02 +0530 Subject: [PATCH] fix(auth): replace console.log with structured logging to prevent state token leaks --- apps/backend/src/routes/auth.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/backend/src/routes/auth.ts b/apps/backend/src/routes/auth.ts index 100a4b5..c0cfe7f 100644 --- a/apps/backend/src/routes/auth.ts +++ b/apps/backend/src/routes/auth.ts @@ -55,8 +55,7 @@ export async function authRoutes(app: FastifyInstance) { state, }); const authUrl = `${GITHUB_AUTH_URL}?${params}`; - console.log('--- GITHUB OAUTH REDIRECT ---'); - console.log('URL:', authUrl); + app.log.debug({ provider: 'github' }, 'OAuth redirect initiated'); return reply.redirect(authUrl); }); @@ -208,8 +207,7 @@ app.get('/github/callback', async (request: FastifyRequest<{ Querystring: OAuthC access_type: 'offline', }); const authUrl = `${GOOGLE_AUTH_URL}?${params}`; - console.log('--- GOOGLE OAUTH REDIRECT ---'); - console.log('URL:', authUrl); + app.log.debug({ provider: 'google' }, 'OAuth redirect initiated'); return reply.redirect(authUrl); });