User creation works locally but not in Prod

I fixed an issue with my endpoint for User Account creation, it was using an old secret. But it’s still not working in Prod, only works locally.

I triple checked the env variables/secret, everything is correct.

My call is like this:

            userInAuth0 = await auth0.users.create({
                connection: 'Username-Password-Authentication',
                email: _email,
                username: _username,
                name: _fullname,
                password: userPasswordGenerated,
                email_verified: true,
            });

And the error:

error: Auth0 user creation error: FetchError: fetch failed

(Before it was throwing the ‘FetchError: The request failed and the interceptors did not return an alternative response)’, which I solved by updating the auth0 library to the latest version)

After looking into the logs, I was able to identify the domain host was not reachable by the server.

[cause]: Error: getaddrinfo ENOTFOUND ‘*..auth0.com’

And in the end I discovered the the quotes in the auth0 domain was the issue, so I removed it on the env file and then it started working.