Auth0 Tutorials: Using MongoDB Atlas as a Custom Database

Hi, @quizapp6781. I think I know what the problem is. Let me see if I get this right:

You probably started reading the article at the very top and implementing the version of the integration that migrates users to Auth0, right? Then, following the article, you switched to the alternative that does not migrate users. However, instead of replacing the Get User script with the one showed on this section, you probably kept the old one there.

If you did that (and the message you were getting makes me believe you did), then that was the problem.

Although subtle, there is a difference on both scripts. The first one contains the following conditional:

if (!user) return callback("User not found.");

The second one contains the following:

if (!user) return callback(null);

This difference allows the Create script (sign up) to keep moving if there is no user on the database. Oh, and to make things a bit clearer. This works like that because Auth0 wants to check if the user that is trying to sign up already exists on your database (to avoid duplicates). That is, the Create script calls the Get User script to make this validation.

Let me know if that helps and solves your problem.