code: function signInOrLinkCredential(credential) {
    if (currentTab == '#user-section') {
      if (!activeUser()) {
        alertError('You need to sign in before linking an account.');
        return;
      }
      activeUser().linkWithCredential(credential)
          .then(function(result) {
            logAdditionalUserInfo(result);
            refreshUserData();
            alertSuccess('Provider linked!');
          }, onAuthError);
    } else {
      auth.signInWithCredential(credential)
          .then(onAuthUserCredentialSuccess, onAuthError);
    }
  }
docs: Signs in or links a provider's credential, based on current tab opened.
  @param {!firebase.auth.AuthCredential} credential The provider's credential.