From 27b1a21384e0ec869b45a38e086ff8c3f9bcacfd Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Fri, 16 May 2025 17:15:52 +0200 Subject: [PATCH] fix(api): log error correctly and differentiate logs (#60404) --- api/src/plugins/auth0.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/plugins/auth0.ts b/api/src/plugins/auth0.ts index 5b9690d0ec8..cee0736b2ef 100644 --- a/api/src/plugins/auth0.ts +++ b/api/src/plugins/auth0.ts @@ -112,7 +112,7 @@ export const auth0Client: FastifyPluginCallbackTypebox = fp( if (error instanceof Error && error.message === 'Invalid state') { logger.error('Auth failed: invalid state'); } else { - logger.error(error, 'Auth failed'); + logger.error(error, 'Failed to get access token from Auth0'); fastify.Sentry.captureException(error); } // It's important _not_ to redirect to /signin here, as that could @@ -135,7 +135,7 @@ export const auth0Client: FastifyPluginCallbackTypebox = fp( throw Error(msg); } } catch (error) { - logger.error({ error }, 'Auth failed'); + logger.error(error, 'Failed to get userinfo from Auth0'); fastify.Sentry.captureException(error); return reply.redirect('/signin'); }