Skip to content

Instantly share code, notes, and snippets.

@saltukalakus
Last active August 29, 2019 21:58
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 saltukalakus/99654c9def90083d42baa76e5b67f4ef to your computer and use it in GitHub Desktop.
Save saltukalakus/99654c9def90083d42baa76e5b67f4ef to your computer and use it in GitHub Desktop.
Rule to force email verification only for some applications on the Auth0 dashboard
function (user, context, callback) {
// Bypass this rule for a particular app
if(context.clientName === 'NameOfTheAppToBypass'){
return callback(null, user, context);
}
// Access should only be granted to verified users otherwise.
if (!user.email || !user.email_verified) {
return callback(new UnauthorizedError('Access denied.'));
}
callback(null, user, context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment