diff --git a/frontend/src/routes/Login.tsx b/frontend/src/routes/Login.tsx index 9c4cec4..db1eb5b 100644 --- a/frontend/src/routes/Login.tsx +++ b/frontend/src/routes/Login.tsx @@ -1,41 +1,23 @@ -import { useState, FormEvent } from 'react' import Box from '@mui/material/Box' import Card from '@mui/material/Card' import CardContent from '@mui/material/CardContent' -import TextField from '@mui/material/TextField' import Button from '@mui/material/Button' import Typography from '@mui/material/Typography' -import Alert from '@mui/material/Alert' -import { authApi } from '../api' export default function Login() { - const [username, setUsername] = useState('') - const [password, setPassword] = useState('') - const [error, setError] = useState('') - - const handleSubmit = async (e: FormEvent) => { - e.preventDefault() - setError('') - try { - await authApi.login(username, password) - window.location.href = '/configs' - } catch { - setError('Invalid username or password') - } - } - return ( Shorefront Sign in to manage your Shorewall configs - {error && {error}} - - setUsername(e.target.value)} sx={{ mb: 2 }} size="small" required /> - setPassword(e.target.value)} sx={{ mb: 3 }} size="small" required /> - - +