From 5ee8b62d67f84555d311a291fdb191ec13b8bed7 Mon Sep 17 00:00:00 2001 From: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:27:35 +0530 Subject: [PATCH] fix: hide content except login when not authenticated to prevent errors (#8398) * fix: hide content except login when not authenticated to prevent errors * Remove supabase folder from tracking * Remove supabase folder from Git tracking * adding git submodule * adding git submodule * Discard changes to .gitignore * only showing AutoGPT logo if user is not present --------- Co-authored-by: Nicholas Tindle Co-authored-by: Nicholas Tindle Co-authored-by: Swifty Co-authored-by: Toran Bruce Richards --- .../frontend/src/app/build/page.tsx | 12 ++++++------ .../frontend/src/components/NavBar.tsx | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/autogpt_platform/frontend/src/app/build/page.tsx b/autogpt_platform/frontend/src/app/build/page.tsx index 6b5ea497e2..55302556aa 100644 --- a/autogpt_platform/frontend/src/app/build/page.tsx +++ b/autogpt_platform/frontend/src/app/build/page.tsx @@ -1,16 +1,16 @@ "use client"; import { useSearchParams } from "next/navigation"; -import FlowEditor from '@/components/Flow'; +import FlowEditor from "@/components/Flow"; export default function Home() { const query = useSearchParams(); return ( - + ); } diff --git a/autogpt_platform/frontend/src/components/NavBar.tsx b/autogpt_platform/frontend/src/components/NavBar.tsx index b22cbd48ea..d7b4c1ef77 100644 --- a/autogpt_platform/frontend/src/components/NavBar.tsx +++ b/autogpt_platform/frontend/src/components/NavBar.tsx @@ -7,7 +7,6 @@ import getServerUser from "@/hooks/getServerUser"; import ProfileDropdown from "./ProfileDropdown"; import { IconCircleUser, IconMenu } from "@/components/ui/icons"; import CreditButton from "@/components/nav/CreditButton"; - import { NavBarButtons } from "./nav/NavBarButtons"; export async function NavBar() { @@ -17,7 +16,7 @@ export async function NavBar() { ); const { user } = await getServerUser(); - return ( + return user ? (
@@ -67,5 +66,19 @@ export async function NavBar() { {isAvailable && user && }
+ ) : ( + ); }