Created
November 12, 2018 12:16
-
-
Save Oldenborg/720b37642f4d52ff9d4fbd705fe0a1a7 to your computer and use it in GitHub Desktop.
Example of the triangle of doom
This file contains hidden or 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
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