code: function getToken(code, token, oauth2Client, isCustomClient) {
      return new Promise((resolve, reject) => {
          if (isCustomClient) {
              getTokenCustom(code, oauth2Client).then((newToken) => {
                  oauth2Client.credentials = newToken;
                  storeToken(newToken);
                  resolve(oauth2Client);
                  return;
              }, (err) => {
                  reject(err);
                  return;
              });
          } else {
              getTokenDefault(code, token, oauth2Client).then((newToken) => {
                  oauth2Client.credentials = newToken;
                  storeToken(newToken);
                  resolve(oauth2Client);
                  return;
              }, (err) => {
                  reject(err);
                  return;
              });
          }
      });
  }
docs: Get and store new token after prompting for user authorization.
  
  @param {google.auth.OAuth2} code - Optional code to get token for.
  @param {google.auth.OAuth2} token - Optional token to refresh.
  @param {google.auth.OAuth2} oauth2Client - The OAuth2 client to get token for.
  @param {bool} isCustomClient - Wether or not this is a custom oauthclient.
  @returns {Promise} - A promise resolving an auth client