Skip to content

Instantly share code, notes, and snippets.

@tanqhnguyen
Created August 16, 2015 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanqhnguyen/d8ff60b4fe62d1ce089b to your computer and use it in GitHub Desktop.
Save tanqhnguyen/d8ff60b4fe62d1ce089b to your computer and use it in GitHub Desktop.
function login(username, password, callback) {
verifyUsername(username, function(error, valid) {
if (error) return callback(error);
if (!valid) return callback('invalid username');
verifyPassword(password, function(error, valid) {
if (error) return callback(error);
if (!valid) return callback('invalid password');
call(null, true);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment