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:
@@ -14,7 +14,7 @@ export function LoginPage() {
|
|||||||
const [password, setPassword] = useState('')
|
const [password, setPassword] = useState('')
|
||||||
const [localError, setLocalError] = 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) => {
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export function RegisterPage() {
|
|||||||
? { email, password, name, invite_code: inviteCode.trim() }
|
? { email, password, name, invite_code: inviteCode.trim() }
|
||||||
: { email, password, name }
|
: { email, password, name }
|
||||||
await register(userData)
|
await register(userData)
|
||||||
navigate('/trees', { replace: true })
|
navigate('/', { replace: true })
|
||||||
} catch {
|
} catch {
|
||||||
// Error is set in the store
|
// Error is set in the store
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user