auth0 / node-auth0

Node.js client library for the Auth0 platform.
MIT License
633 stars 309 forks source link

Data returned from signUp mismatches SignUpResponse #991

Open jdockwarder opened 7 months ago

jdockwarder commented 7 months ago

Checklist

Description

When signing up a new user, using the authentication api, the data returned from auth0.database.signUp() does not match the type SignUp Response.

SignUpResponse is telling there is a id key in the response. The actual response however does not contain that key, but _id. When using the key _id gives me a compilation error, because of the type mismatch.

Reproduction

  1. Sign up a new user using auth0.database.signUp(...)
  2. Check the response for the missing id key

Additional context

I'm using the auth0 sdk in a Nest.js application

node-auth0 version

4.3.1

Node.js version

20.11.0

patlux commented 4 months ago

I can confirm the issue. I get the following as response:

const auth0User = await auth0.database.signUp({ ... })
console.log(JSON.stringify(auth0User.data, null, 2))

{
  "given_name": "Patrick",
  "family_name": "Wozniak",
  "name": "Patrick Wozniak",
  "_id": "66579a6a6f77950e322ced56",
  "email": "hi@patwoz.de",
  "email_verified": false
 }