V4 NextJS SDK Does Not Return Custom Fields on User idToken

Hi @relero90,

Welcome back to the Auth0 Community and thank you for your post.

In the V3 version of the NextJS Auth0 SDK any claims added to the ID token were automatically propagated to the user object. In the V4 version the list of default claims that persist in the user object does not include the metadata.

In order to ensure this metadata is passed to the ID token you can use the beforeSessionSaved hook. Please check out the V4 Migration Guide included in the NextJS SDK for further documentation.

I hope this helped.
Thanks again,
Remus