From 9574230b29275eed53c0e792102cd228a6c9cf37 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Sun, 23 Mar 2025 09:46:11 +0530 Subject: [PATCH] Redirect unauthenticated users to login page instead of home --- .changeset/spicy-words-sing.md | 5 +++++ .../with-auth/packages/client/src/routes/dashboard.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/spicy-words-sing.md diff --git a/.changeset/spicy-words-sing.md b/.changeset/spicy-words-sing.md new file mode 100644 index 0000000..eaccb6b --- /dev/null +++ b/.changeset/spicy-words-sing.md @@ -0,0 +1,5 @@ +--- +"create-better-t-stack": patch +--- + +Redirect unauthenticated users to login page instead of home diff --git a/apps/cli/template/with-auth/packages/client/src/routes/dashboard.tsx b/apps/cli/template/with-auth/packages/client/src/routes/dashboard.tsx index a66ba4b..d6ecac9 100644 --- a/apps/cli/template/with-auth/packages/client/src/routes/dashboard.tsx +++ b/apps/cli/template/with-auth/packages/client/src/routes/dashboard.tsx @@ -17,7 +17,7 @@ function RouteComponent() { useEffect(() => { if (!session && !isPending) { navigate({ - to: "/", + to: "/login", }); } }, [session, isPending]);