Created
November 30, 2017 15:21
-
-
Save ihfazhillah/2138bcc48c6fe0b5298e86f4ed83f094 to your computer and use it in GitHub Desktop.
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 validator = require("email-validator"); | |
module.exports = function(context, callback) { | |
/* | |
* module to check email, context.data.input is a scaphold's CreateUserInput. | |
* email is must be valid email, using email-validator | |
*/ | |
const userInput = context.data.input; | |
if (!validator.validate(userInput.email)) { | |
callback("not valid email provided", null); | |
} | |
callback(null, context.data.input); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment