title: firebase.auth.Auth.signInWithCredential is deprecated. Please use firebase.auth.Auth.signInAndRetrieveDataWithCredential instead
body: <p>When is use this.afAuth.auth.signInWithCredential everything works great in my Ionic app.  I can sign in using Google authentication and the user profile is pushed to firebase.  However, I get an error in the console that signInWithCredential is deprecated and to use signInAndRetrieveDataWithCredential.  The problem is that signInAndRetrieveDataWithCredential doesn't provide any user data(uid, user email, displayname)...it's all null.</p>
  
  <p>So what can I do?  The console error is saying not to use signInWithCredential even though it's working.  signInAndRetrieveDataWithCredential returns null for the user.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  async googleLogin(): Promise&lt;void&gt; {
      try {
  
        const gplusUser = await this.gplus.login({
          'webClientId': environment.googleWebClientId,
          'offline': true,
          'scopes': 'profile email'
        });
        return await this.afAuth.auth.signInWithCredential(
          firebase.auth.GoogleAuthProvider.credential(gplusUser.idToken)
        ).then((credential) =&gt; {
          console.log('creds', credential);
          this.updateUserData(credential);
        });
      } catch (err) {
        console.log(err);
      }
    }
    
        private updateUserData(user) {
      const userRef: firebase.firestore.DocumentReference = firebase.firestore().doc(`users/${user.uid}`);
  
      const data: User = {
        uid: user.uid,
        email: user.email,
        displayName: user.displayName,
      };
      console.log('user data', data);
      return userRef.set(data);
    }</code></pre>
  </div>
  </div>
  </p>