diff --git a/apps/scandic-web/lib/trpc/server.ts b/apps/scandic-web/lib/trpc/server.ts index 230a96990..be0f34bef 100644 --- a/apps/scandic-web/lib/trpc/server.ts +++ b/apps/scandic-web/lib/trpc/server.ts @@ -11,6 +11,7 @@ import { appServerClient, configureServerClient, } from "@scandic-hotels/trpc/serverClient" +import { isValidSession } from "@scandic-hotels/trpc/utils/session" import { webviews } from "@/constants/routes/webviews" @@ -50,6 +51,9 @@ export async function createAppContext() { auth: async () => await getUserSession(), getScandicUserToken: async () => { const session = await getUserSession() + if (!isValidSession(session)) { + return null + } return session?.token?.access_token ?? null }, getUserPointsBalance: async () => {