I am trying user Authentication using firebase.
For Email and password based authentication, I want to check whether the email input by the user in the form really belongs to the user, I can do so by sending a verification link to the user.
So, after the form is submitted and all other validation are complete, i tried the following code:
firebase.auth().createUserWithEmailAndPassword(this.state.email,this.state.password) .then(()=>{ var actionCodesettings={ url: 'https://localhost:3000/?email=' + firebase.auth().currentUser.email, handleCodeInApp: false } firebase.auth.currentUser.sendEmailVerification(actionCodesettings) .then(()=>{ console.log("Email Sent") }) .catch((error)=>{ console.log("Unexpected error occured") }) }) .catch((error)=>{ var errorCode = error.code; if(errorCode === 'auth/email-already-in-use'){ this.setState({ Message:"Email already Used" }) return; } else if(errorCode === 'auth/invalid-email'){ this.setState({ Message:"Email already Used" }) return; } else if(errorCode === 'auth/weak-password'){ this.setState({ Message:"Password is too Weak" }) return; } }) } But I am not recieving any email,neither the message "Email Sent" is logged out.