From 1a7375258f9587b92363ce8c7ece5c11dbc6dad4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:34:10 +0000 Subject: [PATCH 1/5] Initial plan From 8d7350db7be3dee70ddd9c26876e9b7d8e6413dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:38:50 +0000 Subject: [PATCH 2/5] Improve homepage auth redirect UX with faster check and redirecting state Co-authored-by: notkainoa <123281048+notkainoa@users.noreply.github.com> --- src/hooks/isAuthenticated.tsx | 5 +++-- src/views/HomePage.tsx | 8 +++++--- tsconfig.app.tsbuildinfo | 2 +- tsconfig.node.tsbuildinfo | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/hooks/isAuthenticated.tsx b/src/hooks/isAuthenticated.tsx index f01180f..ff48efe 100644 --- a/src/hooks/isAuthenticated.tsx +++ b/src/hooks/isAuthenticated.tsx @@ -2,14 +2,15 @@ import { supabase } from "@/db/supabase"; export default async function isAuthenticated() { try { - const { data, error } = await supabase.auth.getUser(); + // Use getSession() instead of getUser() for faster local check + const { data, error } = await supabase.auth.getSession(); if (error) { console.error("Authentication check error:", error); return false; } - return !!data.user; + return !!data.session; } catch (error) { console.error("Authentication check failed:", error); return false; diff --git a/src/views/HomePage.tsx b/src/views/HomePage.tsx index 579cfa3..1851172 100644 --- a/src/views/HomePage.tsx +++ b/src/views/HomePage.tsx @@ -8,6 +8,7 @@ import { useEffect, useState } from "react"; export default function HomePage() { const navigate = useNavigate(); const [loadingTimeout, setLoadingTimeout] = useState(false); + const [isRedirecting, setIsRedirecting] = useState(false); const { data, isLoading, error } = useQuery({ queryKey: ["user", "authenticated"], @@ -38,6 +39,7 @@ export default function HomePage() { useEffect(() => { if (data === true) { + setIsRedirecting(true); navigate({ to: "/pages" }); } }, [data, navigate]); @@ -71,12 +73,12 @@ export default function HomePage() { your drawings across all your devices.