title: How to display invalid email in authentication in ionic?
body: <p>I'm making a login page and want it to show an alert message whenever the email or password entered by the user is not matched.</p>
  
  <p>Also if the email or password is <strong>not</strong> matched then along with the displayed error, it should <strong>not</strong> go to the next page.</p>
  
  <p>I've written a code which not only does <strong>not</strong> show the alert message, but also <strong>goes</strong> to the next page even if the user is <strong>not authenticated</strong>(i.e there is an error in the email and password entered)
  Here is my code. Please Help !</p>
  
  <pre class="lang-js prettyprint-override"><code>user= {} as User;
  
  async login(user:User)
    {
     try
     {
        const result=this.angfire.auth.signInWithEmailAndPassword(user.email,user.password);
        if(result)
        {
            this.navCtrl.setRoot(HomeManagerPage);
        }
  
  
     }
     catch(e)
     {
         var errorCode = e.code;
         var errorMessage = e.message;
         if (errorCode === 'auth/wrong-password')
         {
           alert('Wrong password.');
         } 
         else
         {
           alert(errorMessage);
         }
         console.log(e);
  
  
     }
  </code></pre>