Auth0 Home Blog Docs

User id undefined with custom database signup

Hi!

I am calling the /dbconnections/signup endpoint to create a user in a custom Postgres database that I configured with a custom create script.

When I tried to implement the resend of the account verification email, which requires a the user_id, I noticed that all my users have the user_id set as “auth0|undefined”, preventing me from resending the verification email using the endpoint /api/v2/jobs/verification-email from the auth0 Management API.

Is there something that I’m missing in order to get the user_id filled?

Sorry if there is any lack of information, I’m pretty new to the platform, I’ll provide more information if needed.

Thanks in advance!

Hi @andrepolicarpobusine,

This likely indicates that your custom database scripts are not setting the user_id attribute in the user profile that is returned from the script. I suggest checking your Login, Sign Up, and Get User scripts to ensure that return a user profile with a populated user_id. As an example, you can how the callback is invoked with a user profile that contains a user_id in the sample script:

Thank you so much!
Filled the user_id in the user profile and sent it in the callback in the Login, Create and Get User scripts and the user_id is now filled in Auth0.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.