Auth0 Home Blog Docs

Custom database scripts not working properly



I have two scripts setup:


function getByEmail (email, callback) {
var request = require(‘request’);
function (err, response, body) {
if(err) {
return callback(new Error(err));
if(response.statusCode !== 200) {
return callback(new Error(body));
callback(null, {
user_id: 123456789,
email: email

This one works great.

Then I try to implement custom Create:

function create (user, callback) {
callback(null, {});

This one has problems. It keeps saying Error. According to wt console sending logs, the GetByEmail script is being sent properly with 200 HTTP code, but then next should be run the create script and it isnt.

Please, can you help me with this case?