I advise to add a small sentence after the “This script will be executed when the user signs up.” description.
What’s the expected return of getUser when no user matches? I now return null instead of an error (I tried both string and Object errors, they all block the call to create).
I just want to make sure that we following the Auth0’s best practices.
For the expected response it is indeed expected to return null in that scenario so your current implementation is correct; the expectations of each script in terms of responses can be found in the comments available above the placeholder implementation when you create the script.
In relation to the docs issue there is a note at (Custom Database Connections) that mentions this situation about the get user script being called before the create for signups.