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 }