Last active
August 29, 2019 21:58
-
-
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
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 (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