code: function authorize(credentials, token) {
      var clientSecret = credentials.installed.client_secret;
      var clientId = credentials.installed.client_id;
      var redirectUrl = credentials.installed.redirect_uris[0];
      var auth = new googleAuth();
      var oauth2Client = new auth.OAuth2(clientId, clientSecret, redirectUrl);
  
      oauth2Client.credentials = token;
      return oauth2Client;
  }
docs: Taken from the quickstart page: https://developers.google.com/gmail/api/quickstart/nodejs, and then converted to use promises. 
  Return an OAuth2 client with the given credentials and token.
  
  @param {Object} credentials The authorization client credentials.
  @param {Object} token An OAuth2 token.