diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts index c480ce13b9..3dbba6e790 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts @@ -3,7 +3,6 @@ import { useBreakpoint } from "@/lib/hooks/useBreakpoint"; import { useSupabase } from "@/lib/supabase/hooks/useSupabase"; import { useChat } from "@ai-sdk/react"; import { DefaultChatTransport } from "ai"; -import { useRouter } from "next/navigation"; import { useEffect, useMemo, useState } from "react"; import { useChatSession } from "./useChatSession"; @@ -11,7 +10,6 @@ export function useCopilotPage() { const { isUserLoading, isLoggedIn } = useSupabase(); const [isDrawerOpen, setIsDrawerOpen] = useState(false); const [pendingMessage, setPendingMessage] = useState(null); - const router = useRouter(); const { sessionId, @@ -54,10 +52,6 @@ export function useCopilotPage() { transport: transport ?? undefined, }); - useEffect(() => { - if (!isUserLoading && !isLoggedIn) router.replace("/login"); - }, [isUserLoading, isLoggedIn]); - useEffect(() => { if (!hydratedMessages || hydratedMessages.length === 0) return; setMessages((prev) => { diff --git a/autogpt_platform/frontend/src/lib/supabase/helpers.ts b/autogpt_platform/frontend/src/lib/supabase/helpers.ts index 26f7711bde..c77e43e7b4 100644 --- a/autogpt_platform/frontend/src/lib/supabase/helpers.ts +++ b/autogpt_platform/frontend/src/lib/supabase/helpers.ts @@ -6,6 +6,7 @@ import { SupabaseClient } from "@supabase/supabase-js"; export const PROTECTED_PAGES = [ "/auth/authorize", "/auth/integrations", + "/copilot", "/monitor", "/build", "/onboarding",