diff --git a/apps/researcher/src/app/[locale]/debug/backend.ts b/apps/researcher/src/app/[locale]/debug/backend.ts index 60b607ba3..dc4690403 100644 --- a/apps/researcher/src/app/[locale]/debug/backend.ts +++ b/apps/researcher/src/app/[locale]/debug/backend.ts @@ -12,7 +12,9 @@ export async function backendLogAction() { const {getToken, sessionId, session, userId} = await auth(); const token = await getToken(); const tokenDecoded = token ? jwtDecode(token) : null; - const date = dateTimeFormat.format(tokenDecoded?.exp * 1000); + const date = tokenDecoded?.exp + ? dateTimeFormat.format(tokenDecoded?.exp * 1000) + : null; console.log('DEBUG BUTTON CLICKED: BACKEND', { date, token, diff --git a/apps/researcher/src/app/[locale]/debug/frontend.tsx b/apps/researcher/src/app/[locale]/debug/frontend.tsx index c559f9e5b..038153e78 100644 --- a/apps/researcher/src/app/[locale]/debug/frontend.tsx +++ b/apps/researcher/src/app/[locale]/debug/frontend.tsx @@ -17,7 +17,9 @@ export function DebugButton() { const onClick = async () => { const token = await getToken(); const tokenDecoded = token ? jwtDecode(token) : null; - const date = dateTimeFormat.format(tokenDecoded?.exp * 1000); + const date = tokenDecoded?.exp + ? dateTimeFormat.format(tokenDecoded?.exp * 1000) + : null; console.log('DEBUG BUTTON CLICKED: FRONTEND', { date, isSignedIn,