title: Handle auth/account-exists-with-different-credential error without error.credential
body: <p>When attempting to log in using a different (than first) login provider, the received error object does not contain a credential property. This is a problem, because any guide I found so far about handling this scenario uses this credentials property to link the two accounts together, so the user can log in with either of the selected providers.</p>
  <p>In other words, after registering an user using Google as the auth provider, then logging out and logging in using Facebook (same e-mail for both accounts), Firebase throws this <code>auth/account-exists-with-different-credential</code> error. The desired behaviour would be to automatically link the new Facebook account together, with the old Google one, and log in the user to my website, but in order to do this, I'd need a credentials object to pass into the <code>linkWithCredential()</code> method (<a href="https://stackoverflow.com/a/44040373/7343397">see this answer for example</a>).</p>
  <p><strong>TL;DR; How to link together two accounts from different providers, but same e-mail address upon the login process?</strong></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>signIn() {
    signInWithRedirect(this.auth, new GoogleAuthProvider());
  }
  
  getRedirectedUser() {
    return await getRedirectResult(this.auth)
      .catch((error) =&gt; {
        await this.handleAuthError(error);
  
        return null;
      });
  }
  
  handleAuthError(error) {
    if (error.code === "auth/account-exists-with-different-credential") {
      // What's next?
    }
  }</code></pre>
  </div>
  </div>
  </p>