
module.exports = function enableAuthentication(server) {
  const connector = server.dataSources.vn.connector

  connector.executeAsync = function(query, params, options = {}, cb) {
    return new Promise((resolve, reject) => {
      this.execute(query, params, options, (error, response) => {
        if (cb)
          cb(error, response);
        if (error)
          reject(error);
        else
          resolve(response);
      });
    });
  }
};
