From 3a146ec946d14ea0adab665de90e597a0cd75fb8 Mon Sep 17 00:00:00 2001 From: Shaun Hamilton Date: Fri, 16 May 2025 12:47:47 +0200 Subject: [PATCH] chore(api): add more auth0 plugin logs (#60398) Co-authored-by: Oliver Eyton-Williams --- api/src/plugins/auth0.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/plugins/auth0.ts b/api/src/plugins/auth0.ts index 541531ac249..5b9690d0ec8 100644 --- a/api/src/plugins/auth0.ts +++ b/api/src/plugins/auth0.ts @@ -128,8 +128,12 @@ export const auth0Client: FastifyPluginCallbackTypebox = fp( const userinfo = (await fastify.auth0OAuth.userinfo(token)) as { email: string; }; + logger.info(`Auth0 userinfo: ${JSON.stringify(userinfo)}`); email = userinfo.email; - if (typeof email !== 'string') throw Error('Invalid userinfo response'); + if (typeof email !== 'string') { + const msg = `Invalid userinfo email: ${JSON.stringify(userinfo)}`; + throw Error(msg); + } } catch (error) { logger.error({ error }, 'Auth failed'); fastify.Sentry.captureException(error);