From 935fc347dfd228c4cac7129a09e20abede74fcd0 Mon Sep 17 00:00:00 2001 From: Denis Lugowski Date: Thu, 6 Nov 2025 18:48:44 +0100 Subject: [PATCH] feat: Enable server health again --- legalconsenthub/app/plugins/server-health.client.ts | 6 +++--- legalconsenthub/server/api/[...].ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/legalconsenthub/app/plugins/server-health.client.ts b/legalconsenthub/app/plugins/server-health.client.ts index 459a29e..880decd 100644 --- a/legalconsenthub/app/plugins/server-health.client.ts +++ b/legalconsenthub/app/plugins/server-health.client.ts @@ -6,8 +6,8 @@ export default defineNuxtPlugin(() => { // Start the health check with a 1-minute interval // This ensures the health check starts even if app.vue's onMounted hasn't fired yet - // nextTick(() => { - // startPeriodicHealthCheck(60000) - // }) + nextTick(() => { + startPeriodicHealthCheck(60000) + }) } }) diff --git a/legalconsenthub/server/api/[...].ts b/legalconsenthub/server/api/[...].ts index 56fb23c..51cc04f 100644 --- a/legalconsenthub/server/api/[...].ts +++ b/legalconsenthub/server/api/[...].ts @@ -12,14 +12,14 @@ export default defineEventHandler(async (event: H3Event) => { const session = await getUserSession(event) const accessToken = session?.jwt?.accessToken - if (!accessToken) { + if (!accessToken && event.path !== '/api/actuator/health') { throw createError({ statusCode: 401, statusMessage: 'Not authenticated' }) } - console.log('🔀 [PROXY] Expiration:', new Date(jwtDecode(accessToken).exp! * 1000).toISOString()) + if (accessToken) console.log('🔀 [PROXY] Expiration:', new Date(jwtDecode(accessToken).exp! * 1000).toISOString()) console.log('🔀 [PROXY] Proxying request to:', target) return proxyRequest(event, target, {