feat: Enable server health again
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user