I'm working on a firebase app that contains an authentication system that allows users to sign up/login and create a profile. The app stores and calls profile info about the users. The system worked just fine until I realized there's no way for a user to reset their password. So I added sendPasswordResetEmail function and it's been downhill since then. I'm a newbie to firebase and to StackOverflow so forgive the mess you're about to see. Am I missing something in that function?
const resetpassword = async () => { const email = document.getElementById('email').value; try { const { user } = auth.sendPasswordResetEmail(email); alert('Password Reset Email Sent!'); } catch(error) { console.log("error ===>", error); if (error.message === "Firebase: Error (auth/user-not-found).") { alert("There is no user corresponding to this email address.")} else (errorCode == 'auth/invalid-email') { alert(errorMessage)} } }