From 9b5e6f3e53dc024497d5e64b532af1048b96192a Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sun, 8 Feb 2026 20:23:44 -0500 Subject: [PATCH] fix: redirect to home page after login/register instead of /trees Co-Authored-By: Claude Opus 4.6 --- frontend/src/pages/LoginPage.tsx | 2 +- frontend/src/pages/RegisterPage.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/LoginPage.tsx b/frontend/src/pages/LoginPage.tsx index b5def516..9bf3769c 100644 --- a/frontend/src/pages/LoginPage.tsx +++ b/frontend/src/pages/LoginPage.tsx @@ -14,7 +14,7 @@ export function LoginPage() { const [password, setPassword] = useState('') const [localError, setLocalError] = useState('') - const from = (location.state as { from?: { pathname: string } })?.from?.pathname || '/trees' + const from = (location.state as { from?: { pathname: string } })?.from?.pathname || '/' const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() diff --git a/frontend/src/pages/RegisterPage.tsx b/frontend/src/pages/RegisterPage.tsx index 19e50ecd..49271890 100644 --- a/frontend/src/pages/RegisterPage.tsx +++ b/frontend/src/pages/RegisterPage.tsx @@ -69,7 +69,7 @@ export function RegisterPage() { ? { email, password, name, invite_code: inviteCode.trim() } : { email, password, name } await register(userData) - navigate('/trees', { replace: true }) + navigate('/', { replace: true }) } catch { // Error is set in the store }