Por favor ayúdenme, ingresé este código a continuación pero no funciona. Cuando doy el correo electrónico y la contraseña correctos, aparece el mensaje de error ->

Aquí está mi código:
const loginUser = (email, password, location, history) => { setIsLoading(true); signInWithEmailAndPassword(auth, email, password) .then(() => { const destination = location?.state?.from || "/"; history.replace(destination); setError(""); }) .catch((error) => { setError(error.message); }) .finally(() => setIsLoading(false)); };