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
function onPreSave(request, response, modules) { | |
if (request.body.email === undefined) { | |
return response.error("Validation Failed, registering users requires an email"); | |
} | |
if (request.body.email.toLowerCase().indexOf("@kinvey.com") == -1){ | |
return response.error("Validation Failed, Registration is only available for employees!"); | |
} | |
response.continue(); | |
} |
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
function onRequest(request, response, modules) { | |
var push = modules.push; | |
push.broadcastMessage("An update is available!"); | |
response.complete(); | |
} |