Created
August 16, 2015 09:37
-
-
Save tanqhnguyen/d8ff60b4fe62d1ce089b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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