function authorize(credentials, callback) {
  const { client_secret, client_id, redirect_uris } = credentials.installed;
  const oAuth2Client = new google.auth.OAuth2(
    client_id,
    client_secret,
    redirect_uris[0]
  );

  // Check if we have previously stored a token.
  fs.readFile(TOKEN_PATH, (err, token) => {
    if (err) return getNewToken(oAuth2Client, callback);
    oAuth2Client.setCredentials(JSON.parse(token));
    callback(oAuth2Client);
  });
}
/**
 * Create an OAuth2 client with the given credentials, and then execute the
 * given callback function.
 * @param {Object} credentials The authorization client credentials.
 * @param {function} callback The callback to call with the authorized client.
 */
Create an OAuth2 client with the given credentials, and then execute the
given callback function.
@param {Object} credentials The authorization client credentials.
@param {function} callback The callback to call with the authorized client.
Create an OAuth2 client with the given credentials and then execute the given callback function . @param { Object } credentials The authorization client credentials . @param { function } callback The callback to call with the authorized client .
function authorize(credentials, callback) {
  const { client_secret, client_id, redirect_uris } = credentials.installed;
  const oAuth2Client = new google.auth.OAuth2(
    client_id,
    client_secret,
    redirect_uris[0]
  );
  fs.readFile(TOKEN_PATH, (err, token) => {
    if (err) return getNewToken(oAuth2Client, callback);
    oAuth2Client.setCredentials(JSON.parse(token));
    callback(oAuth2Client);
  });
}
function authorize ( credentials , callback ) { const { client_secret , client_id , redirect_uris } = credentials . installed ; const oAuth2Client = new google . auth . OAuth2 ( client_id , client_secret , redirect_uris [ 0 ] ) ; fs . readFile ( TOKEN_PATH , ( err , token ) => { if ( err ) return getNewToken ( oAuth2Client , callback ) ; oAuth2Client . setCredentials ( JSON . parse ( token ) ) ; callback ( oAuth2Client ) ; } ) ; }
Create an OAuth2 client with the given credentials, and then execute the
 given callback function.
Create an OAuth2 client with the given credentials and then execute the given callback function .
// Check if we have previously stored a token.