Skip to content

Instantly share code, notes, and snippets.

@Oldenborg
Created November 12, 2018 12:16
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 Oldenborg/720b37642f4d52ff9d4fbd705fe0a1a7 to your computer and use it in GitHub Desktop.
Save Oldenborg/720b37642f4d52ff9d4fbd705fe0a1a7 to your computer and use it in GitHub Desktop.
Example of the triangle of doom
const verifyUser = function(username, password, callback){
dataBase.verifyUser(username, password, (error, userInfo) => {
if (error) {
callback(error)
}else{
dataBase.getRoles(username, (error, roles) => {
if (error){
callback(error)
}else {
dataBase.logAccess(username, (error) => {
if (error){
callback(error);
}else{
callback(null, userInfo, roles);
}
})
}
})
}
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment