title: Firebase web auth: The email address is badly formatted
body: <p>I am trying to make a simple web auth page using firebase auth but getting this error everytime</p>
  
  <pre><code>//HTML: 
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Document&lt;/title&gt;
      &lt;script src="https://www.gstatic.com/firebasejs/5.2.0/firebase.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;label&gt;Email&lt;/label&gt;
      &lt;input type="email" id="txtEmail"&gt;&lt;br/&gt;
      &lt;br/&gt;
      &lt;label&gt;Password&lt;/label&gt;
      &lt;input type="password" id="txtPass"&gt;&lt;br/&gt;&lt;br/&gt;
      &lt;button id="loginButton" onclick="validate();"&gt;Login&lt;/button&gt;
      &lt;script src="auth2.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>//JS File</p>
  
  <pre><code>// Initialize Firebase
    var config = {
      apiKey: "YOUR_API_KEY",
      authDomain: "YOUR_DOMAIN",
      databaseURL: "YOUR_DB_URL",
      projectId: "PROJECT_ID",
      storageBucket: "STORAGE",
      messagingSenderId: "SENDER_ID"
    };
    firebase.initializeApp(config);
  
      var email = document.getElementById("txtEmail").value;
      var pass = document.getElementById("txtPass").value;
  
  
      function validate(){
          const auth = firebase.auth();
          const promise = auth.signInWithEmailAndPassword(email, pass);
          promise.catch(function(error){
              console.log("Got a error", error);
          })
      }
  </code></pre>
  
  <p>I get this error in console:</p>
  
  <pre><code>Fr {code: "auth/invalid-email", message: "The email address is badly formatted."}
  </code></pre>