Skip to content

Commit

Permalink
Update LoginForm.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirAgassi committed Nov 23, 2024
1 parent 022f9a9 commit af32a3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/components/LoginForm.jsx
Original file line number Diff line number Diff line change
@@ -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')
}
}

Expand Down

0 comments on commit af32a3f

Please sign in to comment.