From af32a3fb75024d6711b11a08bf9412fd8706f065 Mon Sep 17 00:00:00 2001 From: AmirAgassi <33383085+AmirAgassi@users.noreply.github.com> Date: Sat, 23 Nov 2024 14:50:35 -0500 Subject: [PATCH] Update LoginForm.jsx --- frontend/src/components/LoginForm.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/LoginForm.jsx b/frontend/src/components/LoginForm.jsx index a9941b1..44600b1 100644 --- a/frontend/src/components/LoginForm.jsx +++ b/frontend/src/components/LoginForm.jsx @@ -1,17 +1,19 @@ import { useState } from 'react' import { useAuth } from '../contexts/AuthContext' +import { useNavigate } from '@tanstack/react-router' import { TextField, Button, Box, Typography } from '@mui/material' export default function LoginForm() { const [email, setEmail] = useState('') const [password, setPassword] = useState('') const { login } = useAuth() + const navigate = useNavigate() const handleSubmit = async (e) => { e.preventDefault() const success = await login(email, password) if (success) { - // redirect to dashboard + navigate('/dashboard') } }