Having issues with Firebase Authentication SDK for handling password reset functionality

14 Views Asked by At

I am using Firebase Authentication SDK for handling password reset functionality in my react app. I am getting a success message even when using a non-registered email. What could be the issue?

  const handleSubmit = async (e) => {
    e.preventDefault();
    setIsLoading(true);
    await sendPasswordResetEmail(auth, email)
      .then(() => {
        setTimeout(() => {
          setIsLoading(false);
        }, 2000);
        toast.success("Password reset link sent!!");
      })
      .catch((error) => {
        const errorMessage = error.message;
        setTimeout(() => {
          setIsLoading(false);
        }, 2000);
        toast.error(errorMessage);
      });
  };
0

There are 0 best solutions below