Auth0 Home Blog Docs

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

custom-database
create-user

#1

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 (a@a.com) 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


#2

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.