From cfff6f786c755ef929c2b622a677df05f1ea5fd3 Mon Sep 17 00:00:00 2001 From: Karl Ludwig Weise Date: Mon, 26 Jan 2026 20:42:51 +0100 Subject: [PATCH] Fix expired access token: Do not check access token for public routes --- src/routes/(pages)/(clients)/+page.svelte | 10 +++++----- src/server-hooks/apiAuthHandle.ts | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/routes/(pages)/(clients)/+page.svelte b/src/routes/(pages)/(clients)/+page.svelte index 694bc2a..92ce078 100644 --- a/src/routes/(pages)/(clients)/+page.svelte +++ b/src/routes/(pages)/(clients)/+page.svelte @@ -38,7 +38,7 @@ {:then tenant} - {#if tenant && tenant.longName} + {#if tenant && tenant.setupState === "READY"}
{#if typeof tenant.logo === "string" && tenant.logo} {/if}
- {tenant?.longName} + {tenant.longName} - {#if tenant?.links.website} + {#if tenant.links.website} diff --git a/src/server-hooks/apiAuthHandle.ts b/src/server-hooks/apiAuthHandle.ts index 2119038..ac5f20a 100644 --- a/src/server-hooks/apiAuthHandle.ts +++ b/src/server-hooks/apiAuthHandle.ts @@ -12,6 +12,15 @@ const GLOBAL_ADMIN_PATHS = ["/api/admin"]; export const apiAuthHandle: Handle = async ({ event, resolve }) => { const { url } = event; const path = url.pathname; + + // Public api paths should be available without authentication + const whitelist = ["/api/public"]; + const skip = whitelist.some((wlPath) => path.startsWith(wlPath)); + if (skip) { + return resolve(event); + } + + // Front-End routes are not handled here if (!path.startsWith("/api")) { return resolve(event); }