Skip to content

Commit e82a7a5

Browse files
authored
handle unauthenticated route (#2321)
1 parent e58f9d7 commit e82a7a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/src/routes/__root.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { Toaster } from '@/components/ui/toaster';
1616
export const Route = createRootRoute({
1717
beforeLoad: async () => {
1818
const { auth, organisationId } = await getAuth();
19-
const organisationDetails = await getOrganisationDetails({data: {organizationId: organisationId}});
20-
return { user: auth.user, organisationId, role: auth.role, organisationName: organisationDetails.name };
19+
const organisationDetails = organisationId ? await getOrganisationDetails({data: {organizationId: organisationId}}) : null;
20+
return { user: auth.user, organisationId, role: auth.role, organisationName: organisationDetails?.name };
2121
},
2222
head: () => ({
2323
meta: [

0 commit comments

Comments
 (0)