lib/index.js
function http_basic (username, password) {
  return function (req, res, next) {
    var credentials = basic_auth(req);
    if (credentials !== undefined) {
      if (credentials.name && credentials.name === username) {
        if (credentials.pass && credentials.pass === password) {
          return next();
        }
      }
    }
    res.set('WWW-Authenticate', 'Basic');
    next(new ErrorUnauthorized('Authentication Failed'));
  };
}
function http_basic (username, password) {
  return function (req, res, next) {
    var credentials = basic_auth(req);
    if (credentials !== undefined) {
      if (credentials.name && credentials.name === username) {
        if (credentials.pass && credentials.pass === password) {
          return next();
        }
      }
    }
    res.set('WWW-Authenticate', 'Basic');
    next(new ErrorUnauthorized('Authentication Failed'));
  };
}
function http_basic ( username , password ) { return function ( req , res , next ) { var credentials = basic_auth ( req ) ; if ( credentials !== undefined ) { if ( credentials . name && credentials . name === username ) { if ( credentials . pass && credentials . pass === password ) { return next ( ) ; } } } res . set ( 'WWW-Authenticate' , 'Basic' ) ; next ( new ErrorUnauthorized ( 'Authentication Failed' ) ) ; } ; }
Also allow multiple users / methods
Also allow multiple users / methods