From e8efc38de996f5271ba71a70b0d0108ebe10e3ae Mon Sep 17 00:00:00 2001 From: motatoes Date: Wed, 15 Oct 2025 15:19:59 -0700 Subject: [PATCH] handle unauthenticated route --- ui/src/routes/__root.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/routes/__root.tsx b/ui/src/routes/__root.tsx index 59f4e74a7..4eb49f208 100644 --- a/ui/src/routes/__root.tsx +++ b/ui/src/routes/__root.tsx @@ -16,8 +16,8 @@ import { Toaster } from '@/components/ui/toaster'; export const Route = createRootRoute({ beforeLoad: async () => { const { auth, organisationId } = await getAuth(); - const organisationDetails = await getOrganisationDetails({data: {organizationId: organisationId}}); - return { user: auth.user, organisationId, role: auth.role, organisationName: organisationDetails.name }; + const organisationDetails = organisationId ? await getOrganisationDetails({data: {organizationId: organisationId}}) : null; + return { user: auth.user, organisationId, role: auth.role, organisationName: organisationDetails?.name }; }, head: () => ({ meta: [