diff --git a/src/pages/Login.js b/src/pages/Login.js index 675ae60..acc5199 100644 --- a/src/pages/Login.js +++ b/src/pages/Login.js @@ -19,7 +19,9 @@ const CredentialFields = () => { const [fail, setFail] = useState(false); const navigate = useNavigate(); - const loginClick = async () => { + const loginClick = async (event) => { + + event.preventDefault(); const username = document.getElementById('username').value; const password = document.getElementById('password').value; if (!username.length || !password.length) return; @@ -35,6 +37,7 @@ const CredentialFields = () => { setUser(await fetchUser()); return navigate('/home'); } + return navigate('verify'); }; @@ -47,7 +50,7 @@ const CredentialFields = () => {
Invalid credentials
: null} - +