Created
March 29, 2019 13:35
-
-
Save woloski/f0070020d18a97edd67a29ac604a29da to your computer and use it in GitHub Desktop.
Pre User Registration hook for Auth0 that block disposable emails
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
const emailVerifier = require("verifier-node"); | |
module.exports = function (user, context, cb) { | |
var response = {}; | |
emailVerifier.verify(user.email, context.webtask.secrets.VERIFIER_APIKEY) | |
.then(response => { | |
if (!response.valid()) return cb(new Error('Disposable email!')); | |
response.user = user; | |
cb(null, response); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, have you a readme on this code? Im looking to get the Verifier_apikey working.
Thank you
Karl