diff --git a/frontend/src/pages/login.js b/frontend/src/pages/login.js index b4149c6..99c0b4e 100644 --- a/frontend/src/pages/login.js +++ b/frontend/src/pages/login.js @@ -8,6 +8,7 @@ export function LoginPage({ dispatch, isLoggedIn, history }) { const [ formData, setFormData ] = useState({username: '', password: ''}); const onUsernameChange = evt => setFormData({ ...formData, username: evt.target.value }); const onPasswordChange = evt => setFormData({ ...formData, password: evt.target.value }); + const onSubmit = evt => { evt.preventDefault(); const { username, password } = formData; @@ -18,9 +19,8 @@ export function LoginPage({ dispatch, isLoggedIn, history }) { if (isLoggedIn) history.push('/home'); }, [isLoggedIn]); - return ( - +