lib/validators/auth.js
function auth(cmd, args, info) {
  var pass = args[0];
  if(pass instanceof Buffer) {
    pass = pass.toString();
  }
  if(!info.conf.requirepass) {
    throw AuthNotSet;
  }else if(pass !== info.conf.requirepass) {
    throw InvalidPassword;
  }
  return true;
}
function auth(cmd, args, info) {
  var pass = args[0];
  if(pass instanceof Buffer) {
    pass = pass.toString();
  }
  if(!info.conf.requirepass) {
    throw AuthNotSet;
  }else if(pass !== info.conf.requirepass) {
    throw InvalidPassword;
  }
  return true;
}
function auth ( cmd , args , info ) { var pass = args [ 0 ] ; if ( pass instanceof Buffer ) { pass = pass . toString ( ) ; } if ( ! info . conf . requirepass ) { throw AuthNotSet ; } else if ( pass !== info . conf . requirepass ) { throw InvalidPassword ; } return true ; }
Authentication validation.

@param cmd The command name - always AUTH.
@param args The command arguments.
@param info The server information.
Authentication validation .