title: Firebase getIdToken not working
body: <p>I'm makeing tests with Firebase Authentication from javascript client and I'm trying to retrieve the idToken with <a href="https://firebase.google.com/docs/auth/admin/verify-id-tokens?hl=es-419#retrieve_id_tokens_on_clients" rel="noreferrer">retrieve id tokens on clients documentation</a> </p>
  
  <p>I think I'm forgetting something basic.</p>
  
  <p>A user is logged in with Google</p>
  
  <p>The code is just i've seen in other posts and in the documentation. And the result is in the comments.</p>
  
  <pre><code>firebase.auth().onAuthStateChanged(function(user) {
    if (user) {
       console.log(user); // this is shown. Firebase user and provider data
       console.log(user.uid); // Shown
          firebase.auth().user.getIdToken().then(function(idToken) {
             console.log(idToken+'--'); // Nothing happens. No errors and the function not continues
          });
       console.log(user.uid); // Nothing happens
    }
  })
  </code></pre>
  
  <p>Thanks</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>if I add anything wrong nothing happens too. for example if I add an alert it shows the alert but if I have a mistake, for example alter() not shows any error. Added catch and nothing too</p>
  
  <pre><code>firebase.auth().onAuthStateChanged(function(user) {
    if (user) {
       alter() // Nothing happens and the function stop         
       console.log(user); // this is shown. Firebase user and provider data
       console.log(user.uid); // Shown
          firebase.auth().user.getIdToken().then(function(idToken) {
             console.log(idToken+'--'); // Nothing happens. No errors and the function not continues
          }).catch(function(error) {
              console.log(error+'--'); // Nothing
          });
       console.log(user.uid); // Nothing happens
    }
  })
  </code></pre>