fix: redirect to home page after login/register instead of /trees

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-02-08 20:23:44 -05:00
parent 4f8b7dd7ca
commit 9b5e6f3e53
2 changed files with 2 additions and 2 deletions

View File

@@ -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()

View File

@@ -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
}