Auth0 Home Blog Docs

Custom database connection: Create script triggers "Invalid email" error



I have a custom database connection whose “Create” script which triggers the [Error] Invalid email error. This error is not generated by my script. To make sure of it, I reduce the script to a simple:

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

So in theory, regardless the input, I should not have any error and the script does nothing. But the error persists. Tested email were of all kinds: dummy ( or real emails.

Strangely enough, I create a new database connection and copy paste the login and create scripts. When trying with “Try connection” (as username is required, I cannot use the “try” functionality), it works well. However, I cannot delete my production database connection and recreate it :frowning:

I tried to search all over the web but I don’t know where this Invalid email error comes from especially considering the fact that even real emails are rejected

Unable to create user calling management API on custom database

My apologies, I found out the root cause: the GetUser script did raise an error when an user is not found instead of returning callback(null); and it appears that after signup, the GetUser script is called out before Create script.