code: function handleReq(config) {
    var authCheck = csrfTokenCheck();
  
    return function (options, callback) {
      if (callback) {
        authCheck({ config: config, options: options, callback: callback });
      } else {
        return new Promise(function (resolve, reject) {
          authCheck({
            config: config,
            options: options,
            callback: function callback(err, res) {
              return err ? reject(err) : resolve(res);
            }
          });
        });
      }
    };
  }
docs: Wrap in a promise if expected