Skip to content

Instantly share code, notes, and snippets.

@bitfishxyz
Created May 3, 2020 12:05
Show Gist options
  • Save bitfishxyz/8a67c081362cdf5dac8aa00e7c258190 to your computer and use it in GitHub Desktop.
Save bitfishxyz/8a67c081362cdf5dac8aa00e7c258190 to your computer and use it in GitHub Desktop.
function checkAuth(data) {
if (data.role !== 'registered') {
console.log('The user is not a registered user');
return false;
}
if (data.grade < 1) {
console.log("The user's level is less than 1");
return false;
}
if (data.job !== 'FE') {
console.log('The user is not a front-end development engineer');
return false;
}
if (data.type !== 'active user') {
console.log('The user is not an active user');
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment