From 4077e9f13a2cfe03109d31462ebcb87846f326c4 Mon Sep 17 00:00:00 2001 From: Barbara Honhoff Date: Fri, 8 Dec 2023 11:45:41 +0100 Subject: [PATCH] Fix error in build --- apps/researcher/src/app/[locale]/debug/backend.ts | 4 +++- apps/researcher/src/app/[locale]/debug/frontend.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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,