Open
Description
Hey Kyle, I did the same thing you did on this project and I noticed that the moment I add the history.push('/') line beneath the login function, it allows users login even if the login credential is invalid.
async function handleSubmit(e) {
e.preventDefault()
try {
setError("")
setLoading(true)
await login(emailRef.current.value, passwordRef.current.value)
history.push("/") --> problem here, it logs in the user with invalid credentials. Even at the sign up component.
} catch {
setError("Failed to log in")
}
setLoading(false)
}
Metadata
Metadata
Assignees
Labels
No labels